From 7f4135403877033ae144bd96a5902468bfc13b5e Mon Sep 17 00:00:00 2001 From: Juan Treminio Date: Mon, 9 Sep 2024 18:16:09 -0500 Subject: [PATCH] Release 1.6.0 --- .editorconfig | 2 +- .github/workflows/python.yml | 38 + .gitignore | 1 + .gitlab-ci.yml | 27 +- .openapi-generator-ignore | 3 - .openapi-generator/FILES | 385 - .openapi-generator/VERSION | 1 - .travis.yml | 6 +- LICENSE | 21 - README.md | 38 +- VERSION | 2 +- bin/replace | 41 +- bin/scan_for | 1 - docs/AccountApi.md | 20 +- docs/AccountCreateRequest.md | 7 +- docs/AccountCreateResponse.md | 11 +- docs/AccountGetResponse.md | 11 +- docs/AccountResponse.md | 15 +- docs/AccountResponseQuotas.md | 19 +- docs/AccountResponseUsage.md | 9 +- docs/AccountUpdateRequest.md | 9 +- docs/AccountVerifyRequest.md | 7 +- docs/AccountVerifyResponse.md | 9 +- docs/AccountVerifyResponseAccount.md | 7 +- docs/ApiAppApi.md | 24 +- docs/ApiAppCreateRequest.md | 11 +- docs/ApiAppGetResponse.md | 11 +- docs/ApiAppListResponse.md | 13 +- docs/ApiAppResponse.md | 11 +- docs/ApiAppResponseOAuth.md | 9 +- docs/ApiAppResponseOptions.md | 7 +- docs/ApiAppResponseOwnerAccount.md | 7 +- docs/ApiAppResponseWhiteLabelingOptions.md | 7 +- docs/ApiAppUpdateRequest.md | 11 +- docs/BulkSendJobApi.md | 12 +- docs/BulkSendJobGetResponse.md | 15 +- ...BulkSendJobGetResponseSignatureRequests.md | 33 +- docs/BulkSendJobListResponse.md | 13 +- docs/BulkSendJobResponse.md | 9 +- docs/BulkSendJobSendResponse.md | 11 +- docs/EmbeddedApi.md | 12 +- docs/EmbeddedEditUrlRequest.md | 11 +- docs/EmbeddedEditUrlResponse.md | 11 +- docs/EmbeddedEditUrlResponseEmbedded.md | 7 +- docs/EmbeddedSignUrlResponse.md | 11 +- docs/EmbeddedSignUrlResponseEmbedded.md | 7 +- docs/ErrorResponse.md | 7 +- docs/ErrorResponseError.md | 7 +- docs/EventCallbackRequest.md | 7 +- docs/EventCallbackRequestEvent.md | 7 +- docs/EventCallbackRequestEventMetadata.md | 15 +- docs/FaxLineAddUserRequest.md | 13 + docs/FaxLineApi.md | 466 ++ docs/FaxLineAreaCodeGetCountryEnum.md | 10 + docs/FaxLineAreaCodeGetProvinceEnum.md | 10 + docs/FaxLineAreaCodeGetResponse.md | 11 + docs/FaxLineAreaCodeGetStateEnum.md | 10 + docs/FaxLineCreateRequest.md | 14 + docs/FaxLineDeleteRequest.md | 11 + docs/FaxLineListResponse.md | 13 + docs/FaxLineRemoveUserRequest.md | 13 + docs/FaxLineResponse.md | 12 + docs/FaxLineResponseFaxLine.md | 14 + docs/FileResponse.md | 11 +- docs/FileResponseDataUri.md | 9 +- docs/ListInfoResponse.md | 9 +- docs/OAuthApi.md | 12 +- docs/OAuthTokenGenerateRequest.md | 9 +- docs/OAuthTokenRefreshRequest.md | 9 +- docs/OAuthTokenResponse.md | 9 +- docs/ReportApi.md | 8 +- docs/ReportCreateRequest.md | 9 +- docs/ReportCreateResponse.md | 11 +- docs/ReportResponse.md | 9 +- docs/SignatureRequestApi.md | 74 +- ...stBulkCreateEmbeddedWithTemplateRequest.md | 19 +- ...atureRequestBulkSendWithTemplateRequest.md | 19 +- docs/SignatureRequestCreateEmbeddedRequest.md | 31 +- ...equestCreateEmbeddedWithTemplateRequest.md | 21 +- docs/SignatureRequestGetResponse.md | 11 +- docs/SignatureRequestListResponse.md | 13 +- docs/SignatureRequestRemindRequest.md | 7 +- docs/SignatureRequestResponse.md | 35 +- docs/SignatureRequestResponseAttachment.md | 11 +- ...SignatureRequestResponseCustomFieldBase.md | 7 +- ...atureRequestResponseCustomFieldCheckbox.md | 9 +- ...SignatureRequestResponseCustomFieldText.md | 9 +- ...atureRequestResponseCustomFieldTypeEnum.md | 7 +- docs/SignatureRequestResponseDataBase.md | 7 +- docs/SignatureRequestResponseDataTypeEnum.md | 7 +- ...gnatureRequestResponseDataValueCheckbox.md | 9 +- ...reRequestResponseDataValueCheckboxMerge.md | 9 +- ...atureRequestResponseDataValueDateSigned.md | 9 +- ...gnatureRequestResponseDataValueDropdown.md | 9 +- ...gnatureRequestResponseDataValueInitials.md | 9 +- .../SignatureRequestResponseDataValueRadio.md | 9 +- ...natureRequestResponseDataValueSignature.md | 9 +- docs/SignatureRequestResponseDataValueText.md | 9 +- ...natureRequestResponseDataValueTextMerge.md | 9 +- docs/SignatureRequestResponseSignatures.md | 37 +- docs/SignatureRequestSendRequest.md | 31 +- ...SignatureRequestSendWithTemplateRequest.md | 21 +- docs/SignatureRequestUpdateRequest.md | 9 +- docs/SubAttachment.md | 7 +- docs/SubBulkSignerList.md | 11 +- docs/SubBulkSignerListCustomField.md | 7 +- docs/SubCC.md | 7 +- docs/SubCustomField.md | 7 +- docs/SubEditorOptions.md | 7 +- docs/SubFieldOptions.md | 7 +- docs/SubFormFieldGroup.md | 7 +- docs/SubFormFieldRule.md | 13 +- docs/SubFormFieldRuleAction.md | 7 +- docs/SubFormFieldRuleTrigger.md | 9 +- docs/SubFormFieldsPerDocumentBase.md | 9 +- docs/SubFormFieldsPerDocumentCheckbox.md | 9 +- docs/SubFormFieldsPerDocumentCheckboxMerge.md | 9 +- docs/SubFormFieldsPerDocumentDateSigned.md | 9 +- docs/SubFormFieldsPerDocumentDropdown.md | 11 +- docs/SubFormFieldsPerDocumentFontEnum.md | 7 +- docs/SubFormFieldsPerDocumentHyperlink.md | 9 +- docs/SubFormFieldsPerDocumentInitials.md | 9 +- docs/SubFormFieldsPerDocumentRadio.md | 9 +- docs/SubFormFieldsPerDocumentSignature.md | 9 +- docs/SubFormFieldsPerDocumentText.md | 9 +- docs/SubFormFieldsPerDocumentTextMerge.md | 9 +- docs/SubFormFieldsPerDocumentTypeEnum.md | 7 +- docs/SubMergeField.md | 7 +- docs/SubOAuth.md | 9 +- docs/SubOptions.md | 7 +- docs/SubSignatureRequestGroupedSigners.md | 11 +- docs/SubSignatureRequestSigner.md | 9 +- docs/SubSignatureRequestTemplateSigner.md | 7 +- docs/SubSigningOptions.md | 7 +- docs/SubTeamResponse.md | 7 +- docs/SubTemplateRole.md | 9 +- docs/SubUnclaimedDraftSigner.md | 9 +- docs/SubUnclaimedDraftTemplateSigner.md | 7 +- docs/SubWhiteLabelingOptions.md | 35 +- docs/TeamAddMemberRequest.md | 7 +- docs/TeamApi.md | 44 +- docs/TeamCreateRequest.md | 9 +- docs/TeamGetInfoResponse.md | 11 +- docs/TeamGetResponse.md | 11 +- docs/TeamInfoResponse.md | 7 +- docs/TeamInviteResponse.md | 7 +- docs/TeamInvitesResponse.md | 11 +- docs/TeamMemberResponse.md | 7 +- docs/TeamMembersResponse.md | 13 +- docs/TeamParentResponse.md | 7 +- docs/TeamRemoveMemberRequest.md | 7 +- docs/TeamResponse.md | 13 +- docs/TeamSubTeamsResponse.md | 13 +- docs/TeamUpdateRequest.md | 7 +- docs/TemplateAddUserRequest.md | 7 +- docs/TemplateApi.md | 52 +- docs/TemplateCreateEmbeddedDraftRequest.md | 27 +- docs/TemplateCreateEmbeddedDraftResponse.md | 11 +- ...lateCreateEmbeddedDraftResponseTemplate.md | 9 +- docs/TemplateCreateRequest.md | 27 +- docs/TemplateCreateResponse.md | 11 +- docs/TemplateCreateResponseTemplate.md | 7 +- docs/TemplateEditResponse.md | 9 +- docs/TemplateGetResponse.md | 11 +- docs/TemplateListResponse.md | 13 +- docs/TemplateRemoveUserRequest.md | 7 +- docs/TemplateResponse.md | 29 +- docs/TemplateResponseAccount.md | 7 +- docs/TemplateResponseAccountQuota.md | 7 +- docs/TemplateResponseCCRole.md | 7 +- docs/TemplateResponseDocument.md | 15 +- ...TemplateResponseDocumentCustomFieldBase.md | 11 +- ...lateResponseDocumentCustomFieldCheckbox.md | 9 +- ...TemplateResponseDocumentCustomFieldText.md | 9 +- docs/TemplateResponseDocumentFieldGroup.md | 7 +- .../TemplateResponseDocumentFieldGroupRule.md | 7 +- docs/TemplateResponseDocumentFormFieldBase.md | 9 +- ...mplateResponseDocumentFormFieldCheckbox.md | 9 +- ...lateResponseDocumentFormFieldDateSigned.md | 9 +- ...mplateResponseDocumentFormFieldDropdown.md | 9 +- ...plateResponseDocumentFormFieldHyperlink.md | 9 +- ...mplateResponseDocumentFormFieldInitials.md | 9 +- .../TemplateResponseDocumentFormFieldRadio.md | 9 +- ...plateResponseDocumentFormFieldSignature.md | 9 +- docs/TemplateResponseDocumentFormFieldText.md | 11 +- ...TemplateResponseDocumentStaticFieldBase.md | 11 +- ...lateResponseDocumentStaticFieldCheckbox.md | 9 +- ...teResponseDocumentStaticFieldDateSigned.md | 9 +- ...lateResponseDocumentStaticFieldDropdown.md | 9 +- ...ateResponseDocumentStaticFieldHyperlink.md | 9 +- ...lateResponseDocumentStaticFieldInitials.md | 9 +- ...emplateResponseDocumentStaticFieldRadio.md | 9 +- ...ateResponseDocumentStaticFieldSignature.md | 9 +- ...TemplateResponseDocumentStaticFieldText.md | 9 +- docs/TemplateResponseFieldAvgTextLength.md | 7 +- docs/TemplateResponseSignerRole.md | 7 +- docs/TemplateUpdateFilesRequest.md | 11 +- docs/TemplateUpdateFilesResponse.md | 9 +- docs/TemplateUpdateFilesResponseTemplate.md | 9 +- docs/UnclaimedDraftApi.md | 20 +- docs/UnclaimedDraftCreateEmbeddedRequest.md | 31 +- ...dDraftCreateEmbeddedWithTemplateRequest.md | 21 +- docs/UnclaimedDraftCreateRequest.md | 29 +- docs/UnclaimedDraftCreateResponse.md | 11 +- docs/UnclaimedDraftEditAndResendRequest.md | 7 +- docs/UnclaimedDraftResponse.md | 15 +- docs/WarningResponse.md | 7 +- dropbox_sign/__init__.py | 206 +- dropbox_sign/api/__init__.py | 18 +- dropbox_sign/api/account_api.py | 1783 +++-- dropbox_sign/api/api_app_api.py | 2157 +++-- dropbox_sign/api/bulk_send_job_api.py | 895 ++- dropbox_sign/api/embedded_api.py | 878 ++- dropbox_sign/api/fax_line_api.py | 2129 +++++ dropbox_sign/api/o_auth_api.py | 868 ++- dropbox_sign/api/report_api.py | 460 +- dropbox_sign/api/signature_request_api.py | 6909 +++++++++++------ dropbox_sign/api/team_api.py | 4265 ++++++---- dropbox_sign/api/template_api.py | 4843 ++++++++---- dropbox_sign/api/unclaimed_draft_api.py | 1824 +++-- dropbox_sign/api_client.py | 1259 ++- dropbox_sign/api_response.py | 21 + dropbox_sign/apis/__init__.py | 14 +- dropbox_sign/configuration.py | 159 +- dropbox_sign/exceptions.py | 101 +- dropbox_sign/model/__init__.py | 5 - dropbox_sign/model/account_create_request.py | 325 - dropbox_sign/model/account_create_response.py | 321 - dropbox_sign/model/account_get_response.py | 306 - dropbox_sign/model/account_response.py | 414 - dropbox_sign/model/account_response_quotas.py | 343 - dropbox_sign/model/account_response_usage.py | 283 - dropbox_sign/model/account_update_request.py | 307 - dropbox_sign/model/account_verify_request.py | 289 - dropbox_sign/model/account_verify_response.py | 306 - .../model/account_verify_response_account.py | 283 - dropbox_sign/model/api_app_create_request.py | 381 - dropbox_sign/model/api_app_get_response.py | 306 - dropbox_sign/model/api_app_list_response.py | 321 - dropbox_sign/model/api_app_response.py | 408 - dropbox_sign/model/api_app_response_o_auth.py | 319 - .../model/api_app_response_options.py | 283 - .../model/api_app_response_owner_account.py | 295 - ...api_app_response_white_labeling_options.py | 439 -- dropbox_sign/model/api_app_update_request.py | 372 - .../model/bulk_send_job_get_response.py | 336 - ...end_job_get_response_signature_requests.py | 639 -- .../model/bulk_send_job_list_response.py | 321 - dropbox_sign/model/bulk_send_job_response.py | 319 - .../model/bulk_send_job_send_response.py | 306 - .../model/embedded_edit_url_request.py | 402 - .../model/embedded_edit_url_response.py | 306 - .../embedded_edit_url_response_embedded.py | 295 - .../model/embedded_sign_url_response.py | 306 - .../embedded_sign_url_response_embedded.py | 295 - dropbox_sign/model/error_response.py | 297 - dropbox_sign/model/error_response_error.py | 315 - dropbox_sign/model/event_callback_request.py | 342 - .../model/event_callback_request_event.py | 362 - .../event_callback_request_event_metadata.py | 319 - dropbox_sign/model/file_response.py | 295 - dropbox_sign/model/file_response_data_uri.py | 283 - dropbox_sign/model/list_info_response.py | 319 - .../model/o_auth_token_generate_request.py | 347 - .../model/o_auth_token_refresh_request.py | 305 - dropbox_sign/model/o_auth_token_response.py | 331 - dropbox_sign/model/report_create_request.py | 325 - dropbox_sign/model/report_create_response.py | 306 - dropbox_sign/model/report_response.py | 323 - ...k_create_embedded_with_template_request.py | 460 -- ...request_bulk_send_with_template_request.py | 458 -- ...gnature_request_create_embedded_request.py | 608 -- ...t_create_embedded_with_template_request.py | 489 -- ...signature_request_edit_embedded_request.py | 608 -- ...est_edit_embedded_with_template_request.py | 489 -- .../model/signature_request_edit_request.py | 626 -- ...ture_request_edit_with_template_request.py | 511 -- .../model/signature_request_get_response.py | 306 - .../model/signature_request_list_response.py | 321 - .../model/signature_request_remind_request.py | 301 - .../model/signature_request_response.py | 588 -- .../signature_request_response_attachment.py | 355 - ...ture_request_response_custom_field_base.py | 342 - ..._request_response_custom_field_checkbox.py | 401 - ...ture_request_response_custom_field_text.py | 401 - ...request_response_custom_field_type_enum.py | 303 - .../signature_request_response_data_base.py | 362 - ...gnature_request_response_data_type_enum.py | 310 - ...re_request_response_data_value_checkbox.py | 399 - ...uest_response_data_value_checkbox_merge.py | 399 - ...request_response_data_value_date_signed.py | 399 - ...re_request_response_data_value_dropdown.py | 399 - ...re_request_response_data_value_initials.py | 399 - ...ature_request_response_data_value_radio.py | 399 - ...e_request_response_data_value_signature.py | 399 - ...nature_request_response_data_value_text.py | 399 - ..._request_response_data_value_text_merge.py | 399 - .../signature_request_response_signatures.py | 499 -- .../model/signature_request_send_request.py | 626 -- ...ture_request_send_with_template_request.py | 511 -- .../model/signature_request_update_request.py | 325 - dropbox_sign/model/sub_attachment.py | 327 - dropbox_sign/model/sub_bulk_signer_list.py | 306 - .../sub_bulk_signer_list_custom_field.py | 303 - dropbox_sign/model/sub_cc.py | 303 - dropbox_sign/model/sub_custom_field.py | 325 - dropbox_sign/model/sub_editor_options.py | 295 - dropbox_sign/model/sub_field_options.py | 297 - dropbox_sign/model/sub_form_field_group.py | 317 - dropbox_sign/model/sub_form_field_rule.py | 351 - .../model/sub_form_field_rule_action.py | 331 - .../model/sub_form_field_rule_trigger.py | 334 - .../sub_form_fields_per_document_base.py | 460 -- .../sub_form_fields_per_document_checkbox.py | 485 -- ...form_fields_per_document_checkbox_merge.py | 461 -- ...ub_form_fields_per_document_date_signed.py | 503 -- .../sub_form_fields_per_document_dropdown.py | 530 -- .../sub_form_fields_per_document_font_enum.py | 317 - .../sub_form_fields_per_document_hyperlink.py | 527 -- .../sub_form_fields_per_document_initials.py | 461 -- .../sub_form_fields_per_document_radio.py | 485 -- .../sub_form_fields_per_document_signature.py | 461 -- .../sub_form_fields_per_document_text.py | 611 -- ...sub_form_fields_per_document_text_merge.py | 503 -- .../sub_form_fields_per_document_type_enum.py | 311 - dropbox_sign/model/sub_merge_field.py | 307 - dropbox_sign/model/sub_o_auth.py | 305 - dropbox_sign/model/sub_options.py | 283 - .../sub_signature_request_grouped_signers.py | 323 - .../model/sub_signature_request_signer.py | 359 - .../sub_signature_request_template_signer.py | 361 - dropbox_sign/model/sub_signing_options.py | 343 - dropbox_sign/model/sub_team_response.py | 295 - dropbox_sign/model/sub_template_role.py | 295 - .../model/sub_unclaimed_draft_signer.py | 315 - .../sub_unclaimed_draft_template_signer.py | 317 - .../model/sub_white_labeling_options.py | 455 -- dropbox_sign/model/team_add_member_request.py | 313 - dropbox_sign/model/team_create_request.py | 283 - dropbox_sign/model/team_get_info_response.py | 306 - dropbox_sign/model/team_get_response.py | 306 - dropbox_sign/model/team_info_response.py | 339 - dropbox_sign/model/team_invite_response.py | 343 - dropbox_sign/model/team_invites_response.py | 306 - dropbox_sign/model/team_member_response.py | 307 - dropbox_sign/model/team_members_response.py | 321 - dropbox_sign/model/team_parent_response.py | 295 - .../model/team_remove_member_request.py | 337 - dropbox_sign/model/team_response.py | 327 - dropbox_sign/model/team_sub_teams_response.py | 321 - dropbox_sign/model/team_update_request.py | 283 - .../model/template_add_user_request.py | 307 - .../template_create_embedded_draft_request.py | 614 -- ...template_create_embedded_draft_response.py | 306 - ...create_embedded_draft_response_template.py | 327 - dropbox_sign/model/template_create_request.py | 529 -- .../model/template_create_response.py | 306 - .../template_create_response_template.py | 283 - dropbox_sign/model/template_edit_response.py | 283 - dropbox_sign/model/template_get_response.py | 306 - dropbox_sign/model/template_list_response.py | 321 - .../model/template_remove_user_request.py | 295 - dropbox_sign/model/template_response.py | 474 -- .../model/template_response_account.py | 351 - .../model/template_response_account_quota.py | 319 - .../model/template_response_cc_role.py | 283 - .../model/template_response_custom_field.py | 301 - .../model/template_response_document.py | 360 - ...template_response_document_custom_field.py | 475 -- ...ate_response_document_custom_field_base.py | 400 - ...response_document_custom_field_checkbox.py | 449 -- ...ate_response_document_custom_field_text.py | 500 -- .../template_response_document_field_group.py | 303 - ...late_response_document_field_group_rule.py | 295 - .../template_response_document_form_field.py | 459 -- ...plate_response_document_form_field_base.py | 424 - ...e_response_document_form_field_checkbox.py | 449 -- ...esponse_document_form_field_date_signed.py | 449 -- ...e_response_document_form_field_dropdown.py | 449 -- ..._response_document_form_field_hyperlink.py | 500 -- ...e_response_document_form_field_initials.py | 449 -- ...late_response_document_form_field_radio.py | 449 -- ..._response_document_form_field_signature.py | 449 -- ...plate_response_document_form_field_text.py | 525 -- ...template_response_document_static_field.py | 391 - ...ate_response_document_static_field_base.py | 424 - ...response_document_static_field_checkbox.py | 449 -- ...ponse_document_static_field_date_signed.py | 449 -- ...response_document_static_field_dropdown.py | 449 -- ...esponse_document_static_field_hyperlink.py | 449 -- ...response_document_static_field_initials.py | 449 -- ...te_response_document_static_field_radio.py | 449 -- ...esponse_document_static_field_signature.py | 449 -- ...ate_response_document_static_field_text.py | 449 -- ...template_response_field_avg_text_length.py | 295 - .../template_response_named_form_field.py | 325 - .../model/template_response_signer_role.py | 295 - .../model/template_update_files_request.py | 349 - .../model/template_update_files_response.py | 291 - ...template_update_files_response_template.py | 303 - ...unclaimed_draft_create_embedded_request.py | 755 -- ...t_create_embedded_with_template_request.py | 675 -- .../model/unclaimed_draft_create_request.py | 606 -- .../model/unclaimed_draft_create_response.py | 306 - ...unclaimed_draft_edit_and_resend_request.py | 381 - .../model/unclaimed_draft_response.py | 343 - dropbox_sign/model/warning_response.py | 303 - dropbox_sign/model_utils.py | 2042 ----- dropbox_sign/models/__init__.py | 377 +- dropbox_sign/models/account_create_request.py | 130 + .../models/account_create_response.py | 144 + dropbox_sign/models/account_get_response.py | 137 + dropbox_sign/models/account_response.py | 159 + .../models/account_response_quotas.py | 136 + dropbox_sign/models/account_response_usage.py | 121 + dropbox_sign/models/account_update_request.py | 127 + dropbox_sign/models/account_verify_request.py | 121 + .../models/account_verify_response.py | 137 + .../models/account_verify_response_account.py | 121 + dropbox_sign/models/api_app_create_request.py | 153 + dropbox_sign/models/api_app_get_response.py | 137 + dropbox_sign/models/api_app_list_response.py | 149 + dropbox_sign/models/api_app_response.py | 165 + .../models/api_app_response_o_auth.py | 131 + .../models/api_app_response_options.py | 121 + .../models/api_app_response_owner_account.py | 124 + ...api_app_response_white_labeling_options.py | 160 + dropbox_sign/models/api_app_update_request.py | 153 + .../models/bulk_send_job_get_response.py | 156 + ...end_job_get_response_signature_requests.py | 231 + .../models/bulk_send_job_list_response.py | 149 + dropbox_sign/models/bulk_send_job_response.py | 130 + .../models/bulk_send_job_send_response.py | 137 + .../models/embedded_edit_url_request.py | 162 + .../models/embedded_edit_url_response.py | 137 + .../embedded_edit_url_response_embedded.py | 124 + .../models/embedded_sign_url_response.py | 137 + .../embedded_sign_url_response_embedded.py | 124 + dropbox_sign/models/error_response.py | 125 + dropbox_sign/models/error_response_error.py | 127 + dropbox_sign/models/event_callback_request.py | 146 + .../models/event_callback_request_event.py | 141 + .../event_callback_request_event_metadata.py | 130 + .../models/fax_line_add_user_request.py | 127 + .../fax_line_area_code_get_country_enum.py | 39 + .../fax_line_area_code_get_province_enum.py | 49 + .../models/fax_line_area_code_get_response.py | 122 + .../fax_line_area_code_get_state_enum.py | 87 + .../models/fax_line_create_request.py | 137 + .../models/fax_line_delete_request.py | 121 + dropbox_sign/models/fax_line_list_response.py | 144 + .../models/fax_line_remove_user_request.py | 127 + dropbox_sign/models/fax_line_response.py | 132 + .../models/fax_line_response_fax_line.py | 139 + dropbox_sign/models/file_response.py | 124 + dropbox_sign/models/file_response_data_uri.py | 121 + dropbox_sign/models/list_info_response.py | 130 + .../models/o_auth_token_generate_request.py | 133 + .../models/o_auth_token_refresh_request.py | 124 + dropbox_sign/models/o_auth_token_response.py | 133 + dropbox_sign/models/report_create_request.py | 137 + dropbox_sign/models/report_create_response.py | 137 + dropbox_sign/models/report_response.py | 142 + ...k_create_embedded_with_template_request.py | 186 + ...request_bulk_send_with_template_request.py | 186 + ...gnature_request_create_embedded_request.py | 265 + ...t_create_embedded_with_template_request.py | 198 + .../models/signature_request_get_response.py | 137 + .../models/signature_request_list_response.py | 149 + .../signature_request_remind_request.py | 124 + .../models/signature_request_response.py | 231 + .../signature_request_response_attachment.py | 136 + ...ture_request_response_custom_field_base.py | 143 + ..._request_response_custom_field_checkbox.py | 133 + ...ture_request_response_custom_field_text.py | 133 + ...request_response_custom_field_type_enum.py | 38 + .../signature_request_response_data_base.py | 164 + ...gnature_request_response_data_type_enum.py | 45 + ...re_request_response_data_value_checkbox.py | 133 + ...uest_response_data_value_checkbox_merge.py | 133 + ...request_response_data_value_date_signed.py | 133 + ...re_request_response_data_value_dropdown.py | 133 + ...re_request_response_data_value_initials.py | 133 + ...ature_request_response_data_value_radio.py | 133 + ...e_request_response_data_value_signature.py | 133 + ...nature_request_response_data_value_text.py | 133 + ..._request_response_data_value_text_merge.py | 133 + .../signature_request_response_signatures.py | 175 + .../models/signature_request_send_request.py | 271 + ...ture_request_send_with_template_request.py | 204 + .../signature_request_update_request.py | 130 + dropbox_sign/models/sub_attachment.py | 130 + dropbox_sign/models/sub_bulk_signer_list.py | 142 + .../sub_bulk_signer_list_custom_field.py | 124 + dropbox_sign/models/sub_cc.py | 124 + dropbox_sign/models/sub_custom_field.py | 130 + dropbox_sign/models/sub_editor_options.py | 124 + dropbox_sign/models/sub_field_options.py | 128 + dropbox_sign/models/sub_form_field_group.py | 127 + dropbox_sign/models/sub_form_field_rule.py | 149 + .../models/sub_form_field_rule_action.py | 137 + .../models/sub_form_field_rule_trigger.py | 138 + .../sub_form_fields_per_document_base.py | 179 + .../sub_form_fields_per_document_checkbox.py | 148 + ...form_fields_per_document_checkbox_merge.py | 142 + ...ub_form_fields_per_document_date_signed.py | 158 + .../sub_form_fields_per_document_dropdown.py | 166 + .../sub_form_fields_per_document_font_enum.py | 52 + .../sub_form_fields_per_document_hyperlink.py | 164 + .../sub_form_fields_per_document_initials.py | 142 + .../sub_form_fields_per_document_radio.py | 148 + .../sub_form_fields_per_document_signature.py | 142 + .../sub_form_fields_per_document_text.py | 192 + ...sub_form_fields_per_document_text_merge.py | 158 + .../sub_form_fields_per_document_type_enum.py | 46 + dropbox_sign/models/sub_merge_field.py | 131 + dropbox_sign/models/sub_o_auth.py | 136 + dropbox_sign/models/sub_options.py | 121 + .../sub_signature_request_grouped_signers.py | 136 + .../models/sub_signature_request_signer.py | 147 + .../sub_signature_request_template_signer.py | 147 + dropbox_sign/models/sub_signing_options.py | 140 + dropbox_sign/models/sub_team_response.py | 124 + dropbox_sign/models/sub_template_role.py | 124 + .../models/sub_unclaimed_draft_signer.py | 127 + .../sub_unclaimed_draft_template_signer.py | 127 + .../models/sub_white_labeling_options.py | 173 + .../models/team_add_member_request.py | 137 + dropbox_sign/models/team_create_request.py | 121 + dropbox_sign/models/team_get_info_response.py | 137 + dropbox_sign/models/team_get_response.py | 137 + dropbox_sign/models/team_info_response.py | 137 + dropbox_sign/models/team_invite_response.py | 136 + dropbox_sign/models/team_invites_response.py | 142 + dropbox_sign/models/team_member_response.py | 127 + dropbox_sign/models/team_members_response.py | 149 + dropbox_sign/models/team_parent_response.py | 124 + .../models/team_remove_member_request.py | 143 + dropbox_sign/models/team_response.py | 148 + .../models/team_sub_teams_response.py | 149 + dropbox_sign/models/team_update_request.py | 121 + .../models/template_add_user_request.py | 127 + .../template_create_embedded_draft_request.py | 259 + ...template_create_embedded_draft_response.py | 137 + ...create_embedded_draft_response_template.py | 139 + .../models/template_create_request.py | 234 + .../models/template_create_response.py | 137 + .../template_create_response_template.py | 121 + dropbox_sign/models/template_edit_response.py | 121 + dropbox_sign/models/template_get_response.py | 137 + dropbox_sign/models/template_list_response.py | 149 + .../models/template_remove_user_request.py | 124 + dropbox_sign/models/template_response.py | 217 + .../models/template_response_account.py | 140 + .../models/template_response_account_quota.py | 130 + .../models/template_response_cc_role.py | 121 + .../models/template_response_document.py | 172 + ...ate_response_document_custom_field_base.py | 153 + ...response_document_custom_field_checkbox.py | 140 + ...ate_response_document_custom_field_text.py | 156 + .../template_response_document_field_group.py | 128 + ...late_response_document_field_group_rule.py | 124 + ...plate_response_document_form_field_base.py | 171 + ...e_response_document_form_field_checkbox.py | 140 + ...esponse_document_form_field_date_signed.py | 140 + ...e_response_document_form_field_dropdown.py | 140 + ..._response_document_form_field_hyperlink.py | 156 + ...e_response_document_form_field_initials.py | 140 + ...late_response_document_form_field_radio.py | 140 + ..._response_document_form_field_signature.py | 140 + ...plate_response_document_form_field_text.py | 169 + ...ate_response_document_static_field_base.py | 171 + ...response_document_static_field_checkbox.py | 140 + ...ponse_document_static_field_date_signed.py | 140 + ...response_document_static_field_dropdown.py | 140 + ...esponse_document_static_field_hyperlink.py | 140 + ...response_document_static_field_initials.py | 140 + ...te_response_document_static_field_radio.py | 140 + ...esponse_document_static_field_signature.py | 140 + ...ate_response_document_static_field_text.py | 140 + ...template_response_field_avg_text_length.py | 124 + .../models/template_response_signer_role.py | 124 + .../models/template_update_files_request.py | 139 + .../models/template_update_files_response.py | 125 + ...template_update_files_response_template.py | 133 + ...unclaimed_draft_create_embedded_request.py | 306 + ...t_create_embedded_with_template_request.py | 251 + .../models/unclaimed_draft_create_request.py | 263 + .../models/unclaimed_draft_create_response.py | 137 + ...unclaimed_draft_edit_and_resend_request.py | 146 + .../models/unclaimed_draft_response.py | 136 + dropbox_sign/models/warning_response.py | 124 + dropbox_sign/py.typed | 0 dropbox_sign/rest.py | 369 +- examples/FaxLineAddUser.py | 23 + examples/FaxLineAreaCodeGet.py | 18 + examples/FaxLineCreate.py | 23 + examples/FaxLineDelete.py | 21 + examples/FaxLineGet.py | 18 + examples/FaxLineList.py | 18 + examples/FaxLineRemoveUser.py | 23 + examples/OauthTokenGenerate.py | 2 +- examples/OauthTokenRefresh.py | 2 +- git_push.sh | 57 + openapi-config.yaml | 9 +- openapi-sdk.yaml | 1080 +++ pyproject.toml | 71 + requirements.txt | 4 +- run-build | 4 +- setup.py | 26 +- templates/README.mustache | 52 +- templates/README_common.mustache | 74 - templates/README_onlypackage.mustache | 4 +- templates/__init__api.mustache | 14 +- templates/__init__apis.mustache | 15 +- templates/__init__model.mustache | 16 +- templates/__init__models.mustache | 16 - templates/__init__package.mustache | 36 +- templates/api.mustache | 579 +- templates/api_client.mustache | 1312 ++-- templates/api_doc.mustache | 34 +- templates/api_doc_example.mustache | 42 + templates/api_response.mustache | 21 + templates/api_test.mustache | 15 +- templates/asyncio/rest.mustache | 196 +- templates/common_README.mustache | 115 + templates/configuration.mustache | 159 +- templates/exceptions.mustache | 102 +- templates/github-workflow.mustache | 39 + templates/gitignore.mustache | 3 + templates/gitlab-ci.mustache | 32 +- templates/model.mustache | 81 +- templates/model_anyof.mustache | 182 + templates/model_doc.mustache | 49 +- templates/model_enum.mustache | 36 + templates/model_generic.mustache | 470 ++ templates/model_oneof.mustache | 209 + templates/model_templates/classvars.mustache | 157 - .../docstring_allowed.mustache | 4 - .../docstring_init_required_kwargs.mustache | 30 - .../docstring_openapi_validations.mustache | 7 - .../model_templates/invalid_pos_args.mustache | 9 - ...method_from_openapi_data_composed.mustache | 66 - .../method_from_openapi_data_normal.mustache | 17 - .../method_from_openapi_data_shared.mustache | 49 - .../method_from_openapi_data_simple.mustache | 62 - .../method_init_composed.mustache | 80 - .../method_init_normal.mustache | 30 - .../method_init_shared.mustache | 52 - .../method_init_simple.mustache | 66 - .../method_set_attribute.mustache | 51 - .../methods_setattr_getattr_composed.mustache | 103 - .../methods_setattr_getattr_normal.mustache | 28 - .../model_templates/methods_shared.mustache | 34 - .../methods_todict_tostr_eq_shared.mustache | 24 - .../methods_tostr_eq_simple.mustache | 16 - .../model_templates/model_composed.mustache | 91 - .../model_templates/model_normal.mustache | 65 - .../model_templates/model_simple.mustache | 22 - .../model_templates/validations.mustache | 34 - templates/model_test.mustache | 45 +- templates/model_utils.mustache | 1732 ----- templates/partial_api.mustache | 52 + templates/partial_api_args.mustache | 18 + templates/partial_header.mustache | 12 +- templates/py.typed.mustache | 0 templates/pyproject.mustache | 82 + templates/python_doc_auth_partial.mustache | 19 +- templates/requirements.mustache | 11 +- templates/rest.mustache | 363 +- templates/setup.mustache | 50 +- templates/setup_cfg.mustache | 11 - templates/signing.mustache | 78 +- templates/test-requirements.mustache | 16 +- templates/tornado/rest.mustache | 150 +- templates/tox.mustache | 2 +- templates/travis.mustache | 11 +- test-requirements.txt | 4 + tests/test_account_api.py | 4 +- tests/test_api_app_api.py | 3 +- tests/test_fixtures.py | 9 +- ...st_model_signature_request_send_request.py | 1 + tests/test_signature_request_api.py | 39 +- tests/test_team_api.py | 3 +- tests/test_utils.py | 8 + 685 files changed, 51545 insertions(+), 87196 deletions(-) create mode 100644 .github/workflows/python.yml delete mode 100644 .openapi-generator/FILES delete mode 100644 .openapi-generator/VERSION delete mode 100644 LICENSE create mode 100644 docs/FaxLineAddUserRequest.md create mode 100644 docs/FaxLineApi.md create mode 100644 docs/FaxLineAreaCodeGetCountryEnum.md create mode 100644 docs/FaxLineAreaCodeGetProvinceEnum.md create mode 100644 docs/FaxLineAreaCodeGetResponse.md create mode 100644 docs/FaxLineAreaCodeGetStateEnum.md create mode 100644 docs/FaxLineCreateRequest.md create mode 100644 docs/FaxLineDeleteRequest.md create mode 100644 docs/FaxLineListResponse.md create mode 100644 docs/FaxLineRemoveUserRequest.md create mode 100644 docs/FaxLineResponse.md create mode 100644 docs/FaxLineResponseFaxLine.md create mode 100644 dropbox_sign/api/fax_line_api.py create mode 100644 dropbox_sign/api_response.py delete mode 100644 dropbox_sign/model/__init__.py delete mode 100644 dropbox_sign/model/account_create_request.py delete mode 100644 dropbox_sign/model/account_create_response.py delete mode 100644 dropbox_sign/model/account_get_response.py delete mode 100644 dropbox_sign/model/account_response.py delete mode 100644 dropbox_sign/model/account_response_quotas.py delete mode 100644 dropbox_sign/model/account_response_usage.py delete mode 100644 dropbox_sign/model/account_update_request.py delete mode 100644 dropbox_sign/model/account_verify_request.py delete mode 100644 dropbox_sign/model/account_verify_response.py delete mode 100644 dropbox_sign/model/account_verify_response_account.py delete mode 100644 dropbox_sign/model/api_app_create_request.py delete mode 100644 dropbox_sign/model/api_app_get_response.py delete mode 100644 dropbox_sign/model/api_app_list_response.py delete mode 100644 dropbox_sign/model/api_app_response.py delete mode 100644 dropbox_sign/model/api_app_response_o_auth.py delete mode 100644 dropbox_sign/model/api_app_response_options.py delete mode 100644 dropbox_sign/model/api_app_response_owner_account.py delete mode 100644 dropbox_sign/model/api_app_response_white_labeling_options.py delete mode 100644 dropbox_sign/model/api_app_update_request.py delete mode 100644 dropbox_sign/model/bulk_send_job_get_response.py delete mode 100644 dropbox_sign/model/bulk_send_job_get_response_signature_requests.py delete mode 100644 dropbox_sign/model/bulk_send_job_list_response.py delete mode 100644 dropbox_sign/model/bulk_send_job_response.py delete mode 100644 dropbox_sign/model/bulk_send_job_send_response.py delete mode 100644 dropbox_sign/model/embedded_edit_url_request.py delete mode 100644 dropbox_sign/model/embedded_edit_url_response.py delete mode 100644 dropbox_sign/model/embedded_edit_url_response_embedded.py delete mode 100644 dropbox_sign/model/embedded_sign_url_response.py delete mode 100644 dropbox_sign/model/embedded_sign_url_response_embedded.py delete mode 100644 dropbox_sign/model/error_response.py delete mode 100644 dropbox_sign/model/error_response_error.py delete mode 100644 dropbox_sign/model/event_callback_request.py delete mode 100644 dropbox_sign/model/event_callback_request_event.py delete mode 100644 dropbox_sign/model/event_callback_request_event_metadata.py delete mode 100644 dropbox_sign/model/file_response.py delete mode 100644 dropbox_sign/model/file_response_data_uri.py delete mode 100644 dropbox_sign/model/list_info_response.py delete mode 100644 dropbox_sign/model/o_auth_token_generate_request.py delete mode 100644 dropbox_sign/model/o_auth_token_refresh_request.py delete mode 100644 dropbox_sign/model/o_auth_token_response.py delete mode 100644 dropbox_sign/model/report_create_request.py delete mode 100644 dropbox_sign/model/report_create_response.py delete mode 100644 dropbox_sign/model/report_response.py delete mode 100644 dropbox_sign/model/signature_request_bulk_create_embedded_with_template_request.py delete mode 100644 dropbox_sign/model/signature_request_bulk_send_with_template_request.py delete mode 100644 dropbox_sign/model/signature_request_create_embedded_request.py delete mode 100644 dropbox_sign/model/signature_request_create_embedded_with_template_request.py delete mode 100644 dropbox_sign/model/signature_request_edit_embedded_request.py delete mode 100644 dropbox_sign/model/signature_request_edit_embedded_with_template_request.py delete mode 100644 dropbox_sign/model/signature_request_edit_request.py delete mode 100644 dropbox_sign/model/signature_request_edit_with_template_request.py delete mode 100644 dropbox_sign/model/signature_request_get_response.py delete mode 100644 dropbox_sign/model/signature_request_list_response.py delete mode 100644 dropbox_sign/model/signature_request_remind_request.py delete mode 100644 dropbox_sign/model/signature_request_response.py delete mode 100644 dropbox_sign/model/signature_request_response_attachment.py delete mode 100644 dropbox_sign/model/signature_request_response_custom_field_base.py delete mode 100644 dropbox_sign/model/signature_request_response_custom_field_checkbox.py delete mode 100644 dropbox_sign/model/signature_request_response_custom_field_text.py delete mode 100644 dropbox_sign/model/signature_request_response_custom_field_type_enum.py delete mode 100644 dropbox_sign/model/signature_request_response_data_base.py delete mode 100644 dropbox_sign/model/signature_request_response_data_type_enum.py delete mode 100644 dropbox_sign/model/signature_request_response_data_value_checkbox.py delete mode 100644 dropbox_sign/model/signature_request_response_data_value_checkbox_merge.py delete mode 100644 dropbox_sign/model/signature_request_response_data_value_date_signed.py delete mode 100644 dropbox_sign/model/signature_request_response_data_value_dropdown.py delete mode 100644 dropbox_sign/model/signature_request_response_data_value_initials.py delete mode 100644 dropbox_sign/model/signature_request_response_data_value_radio.py delete mode 100644 dropbox_sign/model/signature_request_response_data_value_signature.py delete mode 100644 dropbox_sign/model/signature_request_response_data_value_text.py delete mode 100644 dropbox_sign/model/signature_request_response_data_value_text_merge.py delete mode 100644 dropbox_sign/model/signature_request_response_signatures.py delete mode 100644 dropbox_sign/model/signature_request_send_request.py delete mode 100644 dropbox_sign/model/signature_request_send_with_template_request.py delete mode 100644 dropbox_sign/model/signature_request_update_request.py delete mode 100644 dropbox_sign/model/sub_attachment.py delete mode 100644 dropbox_sign/model/sub_bulk_signer_list.py delete mode 100644 dropbox_sign/model/sub_bulk_signer_list_custom_field.py delete mode 100644 dropbox_sign/model/sub_cc.py delete mode 100644 dropbox_sign/model/sub_custom_field.py delete mode 100644 dropbox_sign/model/sub_editor_options.py delete mode 100644 dropbox_sign/model/sub_field_options.py delete mode 100644 dropbox_sign/model/sub_form_field_group.py delete mode 100644 dropbox_sign/model/sub_form_field_rule.py delete mode 100644 dropbox_sign/model/sub_form_field_rule_action.py delete mode 100644 dropbox_sign/model/sub_form_field_rule_trigger.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_base.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_checkbox.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_checkbox_merge.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_date_signed.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_dropdown.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_font_enum.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_hyperlink.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_initials.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_radio.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_signature.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_text.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_text_merge.py delete mode 100644 dropbox_sign/model/sub_form_fields_per_document_type_enum.py delete mode 100644 dropbox_sign/model/sub_merge_field.py delete mode 100644 dropbox_sign/model/sub_o_auth.py delete mode 100644 dropbox_sign/model/sub_options.py delete mode 100644 dropbox_sign/model/sub_signature_request_grouped_signers.py delete mode 100644 dropbox_sign/model/sub_signature_request_signer.py delete mode 100644 dropbox_sign/model/sub_signature_request_template_signer.py delete mode 100644 dropbox_sign/model/sub_signing_options.py delete mode 100644 dropbox_sign/model/sub_team_response.py delete mode 100644 dropbox_sign/model/sub_template_role.py delete mode 100644 dropbox_sign/model/sub_unclaimed_draft_signer.py delete mode 100644 dropbox_sign/model/sub_unclaimed_draft_template_signer.py delete mode 100644 dropbox_sign/model/sub_white_labeling_options.py delete mode 100644 dropbox_sign/model/team_add_member_request.py delete mode 100644 dropbox_sign/model/team_create_request.py delete mode 100644 dropbox_sign/model/team_get_info_response.py delete mode 100644 dropbox_sign/model/team_get_response.py delete mode 100644 dropbox_sign/model/team_info_response.py delete mode 100644 dropbox_sign/model/team_invite_response.py delete mode 100644 dropbox_sign/model/team_invites_response.py delete mode 100644 dropbox_sign/model/team_member_response.py delete mode 100644 dropbox_sign/model/team_members_response.py delete mode 100644 dropbox_sign/model/team_parent_response.py delete mode 100644 dropbox_sign/model/team_remove_member_request.py delete mode 100644 dropbox_sign/model/team_response.py delete mode 100644 dropbox_sign/model/team_sub_teams_response.py delete mode 100644 dropbox_sign/model/team_update_request.py delete mode 100644 dropbox_sign/model/template_add_user_request.py delete mode 100644 dropbox_sign/model/template_create_embedded_draft_request.py delete mode 100644 dropbox_sign/model/template_create_embedded_draft_response.py delete mode 100644 dropbox_sign/model/template_create_embedded_draft_response_template.py delete mode 100644 dropbox_sign/model/template_create_request.py delete mode 100644 dropbox_sign/model/template_create_response.py delete mode 100644 dropbox_sign/model/template_create_response_template.py delete mode 100644 dropbox_sign/model/template_edit_response.py delete mode 100644 dropbox_sign/model/template_get_response.py delete mode 100644 dropbox_sign/model/template_list_response.py delete mode 100644 dropbox_sign/model/template_remove_user_request.py delete mode 100644 dropbox_sign/model/template_response.py delete mode 100644 dropbox_sign/model/template_response_account.py delete mode 100644 dropbox_sign/model/template_response_account_quota.py delete mode 100644 dropbox_sign/model/template_response_cc_role.py delete mode 100644 dropbox_sign/model/template_response_custom_field.py delete mode 100644 dropbox_sign/model/template_response_document.py delete mode 100644 dropbox_sign/model/template_response_document_custom_field.py delete mode 100644 dropbox_sign/model/template_response_document_custom_field_base.py delete mode 100644 dropbox_sign/model/template_response_document_custom_field_checkbox.py delete mode 100644 dropbox_sign/model/template_response_document_custom_field_text.py delete mode 100644 dropbox_sign/model/template_response_document_field_group.py delete mode 100644 dropbox_sign/model/template_response_document_field_group_rule.py delete mode 100644 dropbox_sign/model/template_response_document_form_field.py delete mode 100644 dropbox_sign/model/template_response_document_form_field_base.py delete mode 100644 dropbox_sign/model/template_response_document_form_field_checkbox.py delete mode 100644 dropbox_sign/model/template_response_document_form_field_date_signed.py delete mode 100644 dropbox_sign/model/template_response_document_form_field_dropdown.py delete mode 100644 dropbox_sign/model/template_response_document_form_field_hyperlink.py delete mode 100644 dropbox_sign/model/template_response_document_form_field_initials.py delete mode 100644 dropbox_sign/model/template_response_document_form_field_radio.py delete mode 100644 dropbox_sign/model/template_response_document_form_field_signature.py delete mode 100644 dropbox_sign/model/template_response_document_form_field_text.py delete mode 100644 dropbox_sign/model/template_response_document_static_field.py delete mode 100644 dropbox_sign/model/template_response_document_static_field_base.py delete mode 100644 dropbox_sign/model/template_response_document_static_field_checkbox.py delete mode 100644 dropbox_sign/model/template_response_document_static_field_date_signed.py delete mode 100644 dropbox_sign/model/template_response_document_static_field_dropdown.py delete mode 100644 dropbox_sign/model/template_response_document_static_field_hyperlink.py delete mode 100644 dropbox_sign/model/template_response_document_static_field_initials.py delete mode 100644 dropbox_sign/model/template_response_document_static_field_radio.py delete mode 100644 dropbox_sign/model/template_response_document_static_field_signature.py delete mode 100644 dropbox_sign/model/template_response_document_static_field_text.py delete mode 100644 dropbox_sign/model/template_response_field_avg_text_length.py delete mode 100644 dropbox_sign/model/template_response_named_form_field.py delete mode 100644 dropbox_sign/model/template_response_signer_role.py delete mode 100644 dropbox_sign/model/template_update_files_request.py delete mode 100644 dropbox_sign/model/template_update_files_response.py delete mode 100644 dropbox_sign/model/template_update_files_response_template.py delete mode 100644 dropbox_sign/model/unclaimed_draft_create_embedded_request.py delete mode 100644 dropbox_sign/model/unclaimed_draft_create_embedded_with_template_request.py delete mode 100644 dropbox_sign/model/unclaimed_draft_create_request.py delete mode 100644 dropbox_sign/model/unclaimed_draft_create_response.py delete mode 100644 dropbox_sign/model/unclaimed_draft_edit_and_resend_request.py delete mode 100644 dropbox_sign/model/unclaimed_draft_response.py delete mode 100644 dropbox_sign/model/warning_response.py delete mode 100644 dropbox_sign/model_utils.py create mode 100644 dropbox_sign/models/account_create_request.py create mode 100644 dropbox_sign/models/account_create_response.py create mode 100644 dropbox_sign/models/account_get_response.py create mode 100644 dropbox_sign/models/account_response.py create mode 100644 dropbox_sign/models/account_response_quotas.py create mode 100644 dropbox_sign/models/account_response_usage.py create mode 100644 dropbox_sign/models/account_update_request.py create mode 100644 dropbox_sign/models/account_verify_request.py create mode 100644 dropbox_sign/models/account_verify_response.py create mode 100644 dropbox_sign/models/account_verify_response_account.py create mode 100644 dropbox_sign/models/api_app_create_request.py create mode 100644 dropbox_sign/models/api_app_get_response.py create mode 100644 dropbox_sign/models/api_app_list_response.py create mode 100644 dropbox_sign/models/api_app_response.py create mode 100644 dropbox_sign/models/api_app_response_o_auth.py create mode 100644 dropbox_sign/models/api_app_response_options.py create mode 100644 dropbox_sign/models/api_app_response_owner_account.py create mode 100644 dropbox_sign/models/api_app_response_white_labeling_options.py create mode 100644 dropbox_sign/models/api_app_update_request.py create mode 100644 dropbox_sign/models/bulk_send_job_get_response.py create mode 100644 dropbox_sign/models/bulk_send_job_get_response_signature_requests.py create mode 100644 dropbox_sign/models/bulk_send_job_list_response.py create mode 100644 dropbox_sign/models/bulk_send_job_response.py create mode 100644 dropbox_sign/models/bulk_send_job_send_response.py create mode 100644 dropbox_sign/models/embedded_edit_url_request.py create mode 100644 dropbox_sign/models/embedded_edit_url_response.py create mode 100644 dropbox_sign/models/embedded_edit_url_response_embedded.py create mode 100644 dropbox_sign/models/embedded_sign_url_response.py create mode 100644 dropbox_sign/models/embedded_sign_url_response_embedded.py create mode 100644 dropbox_sign/models/error_response.py create mode 100644 dropbox_sign/models/error_response_error.py create mode 100644 dropbox_sign/models/event_callback_request.py create mode 100644 dropbox_sign/models/event_callback_request_event.py create mode 100644 dropbox_sign/models/event_callback_request_event_metadata.py create mode 100644 dropbox_sign/models/fax_line_add_user_request.py create mode 100644 dropbox_sign/models/fax_line_area_code_get_country_enum.py create mode 100644 dropbox_sign/models/fax_line_area_code_get_province_enum.py create mode 100644 dropbox_sign/models/fax_line_area_code_get_response.py create mode 100644 dropbox_sign/models/fax_line_area_code_get_state_enum.py create mode 100644 dropbox_sign/models/fax_line_create_request.py create mode 100644 dropbox_sign/models/fax_line_delete_request.py create mode 100644 dropbox_sign/models/fax_line_list_response.py create mode 100644 dropbox_sign/models/fax_line_remove_user_request.py create mode 100644 dropbox_sign/models/fax_line_response.py create mode 100644 dropbox_sign/models/fax_line_response_fax_line.py create mode 100644 dropbox_sign/models/file_response.py create mode 100644 dropbox_sign/models/file_response_data_uri.py create mode 100644 dropbox_sign/models/list_info_response.py create mode 100644 dropbox_sign/models/o_auth_token_generate_request.py create mode 100644 dropbox_sign/models/o_auth_token_refresh_request.py create mode 100644 dropbox_sign/models/o_auth_token_response.py create mode 100644 dropbox_sign/models/report_create_request.py create mode 100644 dropbox_sign/models/report_create_response.py create mode 100644 dropbox_sign/models/report_response.py create mode 100644 dropbox_sign/models/signature_request_bulk_create_embedded_with_template_request.py create mode 100644 dropbox_sign/models/signature_request_bulk_send_with_template_request.py create mode 100644 dropbox_sign/models/signature_request_create_embedded_request.py create mode 100644 dropbox_sign/models/signature_request_create_embedded_with_template_request.py create mode 100644 dropbox_sign/models/signature_request_get_response.py create mode 100644 dropbox_sign/models/signature_request_list_response.py create mode 100644 dropbox_sign/models/signature_request_remind_request.py create mode 100644 dropbox_sign/models/signature_request_response.py create mode 100644 dropbox_sign/models/signature_request_response_attachment.py create mode 100644 dropbox_sign/models/signature_request_response_custom_field_base.py create mode 100644 dropbox_sign/models/signature_request_response_custom_field_checkbox.py create mode 100644 dropbox_sign/models/signature_request_response_custom_field_text.py create mode 100644 dropbox_sign/models/signature_request_response_custom_field_type_enum.py create mode 100644 dropbox_sign/models/signature_request_response_data_base.py create mode 100644 dropbox_sign/models/signature_request_response_data_type_enum.py create mode 100644 dropbox_sign/models/signature_request_response_data_value_checkbox.py create mode 100644 dropbox_sign/models/signature_request_response_data_value_checkbox_merge.py create mode 100644 dropbox_sign/models/signature_request_response_data_value_date_signed.py create mode 100644 dropbox_sign/models/signature_request_response_data_value_dropdown.py create mode 100644 dropbox_sign/models/signature_request_response_data_value_initials.py create mode 100644 dropbox_sign/models/signature_request_response_data_value_radio.py create mode 100644 dropbox_sign/models/signature_request_response_data_value_signature.py create mode 100644 dropbox_sign/models/signature_request_response_data_value_text.py create mode 100644 dropbox_sign/models/signature_request_response_data_value_text_merge.py create mode 100644 dropbox_sign/models/signature_request_response_signatures.py create mode 100644 dropbox_sign/models/signature_request_send_request.py create mode 100644 dropbox_sign/models/signature_request_send_with_template_request.py create mode 100644 dropbox_sign/models/signature_request_update_request.py create mode 100644 dropbox_sign/models/sub_attachment.py create mode 100644 dropbox_sign/models/sub_bulk_signer_list.py create mode 100644 dropbox_sign/models/sub_bulk_signer_list_custom_field.py create mode 100644 dropbox_sign/models/sub_cc.py create mode 100644 dropbox_sign/models/sub_custom_field.py create mode 100644 dropbox_sign/models/sub_editor_options.py create mode 100644 dropbox_sign/models/sub_field_options.py create mode 100644 dropbox_sign/models/sub_form_field_group.py create mode 100644 dropbox_sign/models/sub_form_field_rule.py create mode 100644 dropbox_sign/models/sub_form_field_rule_action.py create mode 100644 dropbox_sign/models/sub_form_field_rule_trigger.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_base.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_checkbox.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_checkbox_merge.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_date_signed.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_dropdown.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_font_enum.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_hyperlink.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_initials.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_radio.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_signature.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_text.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_text_merge.py create mode 100644 dropbox_sign/models/sub_form_fields_per_document_type_enum.py create mode 100644 dropbox_sign/models/sub_merge_field.py create mode 100644 dropbox_sign/models/sub_o_auth.py create mode 100644 dropbox_sign/models/sub_options.py create mode 100644 dropbox_sign/models/sub_signature_request_grouped_signers.py create mode 100644 dropbox_sign/models/sub_signature_request_signer.py create mode 100644 dropbox_sign/models/sub_signature_request_template_signer.py create mode 100644 dropbox_sign/models/sub_signing_options.py create mode 100644 dropbox_sign/models/sub_team_response.py create mode 100644 dropbox_sign/models/sub_template_role.py create mode 100644 dropbox_sign/models/sub_unclaimed_draft_signer.py create mode 100644 dropbox_sign/models/sub_unclaimed_draft_template_signer.py create mode 100644 dropbox_sign/models/sub_white_labeling_options.py create mode 100644 dropbox_sign/models/team_add_member_request.py create mode 100644 dropbox_sign/models/team_create_request.py create mode 100644 dropbox_sign/models/team_get_info_response.py create mode 100644 dropbox_sign/models/team_get_response.py create mode 100644 dropbox_sign/models/team_info_response.py create mode 100644 dropbox_sign/models/team_invite_response.py create mode 100644 dropbox_sign/models/team_invites_response.py create mode 100644 dropbox_sign/models/team_member_response.py create mode 100644 dropbox_sign/models/team_members_response.py create mode 100644 dropbox_sign/models/team_parent_response.py create mode 100644 dropbox_sign/models/team_remove_member_request.py create mode 100644 dropbox_sign/models/team_response.py create mode 100644 dropbox_sign/models/team_sub_teams_response.py create mode 100644 dropbox_sign/models/team_update_request.py create mode 100644 dropbox_sign/models/template_add_user_request.py create mode 100644 dropbox_sign/models/template_create_embedded_draft_request.py create mode 100644 dropbox_sign/models/template_create_embedded_draft_response.py create mode 100644 dropbox_sign/models/template_create_embedded_draft_response_template.py create mode 100644 dropbox_sign/models/template_create_request.py create mode 100644 dropbox_sign/models/template_create_response.py create mode 100644 dropbox_sign/models/template_create_response_template.py create mode 100644 dropbox_sign/models/template_edit_response.py create mode 100644 dropbox_sign/models/template_get_response.py create mode 100644 dropbox_sign/models/template_list_response.py create mode 100644 dropbox_sign/models/template_remove_user_request.py create mode 100644 dropbox_sign/models/template_response.py create mode 100644 dropbox_sign/models/template_response_account.py create mode 100644 dropbox_sign/models/template_response_account_quota.py create mode 100644 dropbox_sign/models/template_response_cc_role.py create mode 100644 dropbox_sign/models/template_response_document.py create mode 100644 dropbox_sign/models/template_response_document_custom_field_base.py create mode 100644 dropbox_sign/models/template_response_document_custom_field_checkbox.py create mode 100644 dropbox_sign/models/template_response_document_custom_field_text.py create mode 100644 dropbox_sign/models/template_response_document_field_group.py create mode 100644 dropbox_sign/models/template_response_document_field_group_rule.py create mode 100644 dropbox_sign/models/template_response_document_form_field_base.py create mode 100644 dropbox_sign/models/template_response_document_form_field_checkbox.py create mode 100644 dropbox_sign/models/template_response_document_form_field_date_signed.py create mode 100644 dropbox_sign/models/template_response_document_form_field_dropdown.py create mode 100644 dropbox_sign/models/template_response_document_form_field_hyperlink.py create mode 100644 dropbox_sign/models/template_response_document_form_field_initials.py create mode 100644 dropbox_sign/models/template_response_document_form_field_radio.py create mode 100644 dropbox_sign/models/template_response_document_form_field_signature.py create mode 100644 dropbox_sign/models/template_response_document_form_field_text.py create mode 100644 dropbox_sign/models/template_response_document_static_field_base.py create mode 100644 dropbox_sign/models/template_response_document_static_field_checkbox.py create mode 100644 dropbox_sign/models/template_response_document_static_field_date_signed.py create mode 100644 dropbox_sign/models/template_response_document_static_field_dropdown.py create mode 100644 dropbox_sign/models/template_response_document_static_field_hyperlink.py create mode 100644 dropbox_sign/models/template_response_document_static_field_initials.py create mode 100644 dropbox_sign/models/template_response_document_static_field_radio.py create mode 100644 dropbox_sign/models/template_response_document_static_field_signature.py create mode 100644 dropbox_sign/models/template_response_document_static_field_text.py create mode 100644 dropbox_sign/models/template_response_field_avg_text_length.py create mode 100644 dropbox_sign/models/template_response_signer_role.py create mode 100644 dropbox_sign/models/template_update_files_request.py create mode 100644 dropbox_sign/models/template_update_files_response.py create mode 100644 dropbox_sign/models/template_update_files_response_template.py create mode 100644 dropbox_sign/models/unclaimed_draft_create_embedded_request.py create mode 100644 dropbox_sign/models/unclaimed_draft_create_embedded_with_template_request.py create mode 100644 dropbox_sign/models/unclaimed_draft_create_request.py create mode 100644 dropbox_sign/models/unclaimed_draft_create_response.py create mode 100644 dropbox_sign/models/unclaimed_draft_edit_and_resend_request.py create mode 100644 dropbox_sign/models/unclaimed_draft_response.py create mode 100644 dropbox_sign/models/warning_response.py create mode 100644 dropbox_sign/py.typed create mode 100644 examples/FaxLineAddUser.py create mode 100644 examples/FaxLineAreaCodeGet.py create mode 100644 examples/FaxLineCreate.py create mode 100644 examples/FaxLineDelete.py create mode 100644 examples/FaxLineGet.py create mode 100644 examples/FaxLineList.py create mode 100644 examples/FaxLineRemoveUser.py create mode 100644 git_push.sh create mode 100644 pyproject.toml delete mode 100644 templates/README_common.mustache delete mode 100644 templates/__init__models.mustache create mode 100644 templates/api_response.mustache create mode 100644 templates/common_README.mustache create mode 100644 templates/github-workflow.mustache create mode 100644 templates/model_anyof.mustache create mode 100644 templates/model_enum.mustache create mode 100644 templates/model_generic.mustache create mode 100644 templates/model_oneof.mustache delete mode 100644 templates/model_templates/classvars.mustache delete mode 100644 templates/model_templates/docstring_allowed.mustache delete mode 100644 templates/model_templates/docstring_init_required_kwargs.mustache delete mode 100644 templates/model_templates/docstring_openapi_validations.mustache delete mode 100644 templates/model_templates/invalid_pos_args.mustache delete mode 100644 templates/model_templates/method_from_openapi_data_composed.mustache delete mode 100644 templates/model_templates/method_from_openapi_data_normal.mustache delete mode 100644 templates/model_templates/method_from_openapi_data_shared.mustache delete mode 100644 templates/model_templates/method_from_openapi_data_simple.mustache delete mode 100644 templates/model_templates/method_init_composed.mustache delete mode 100644 templates/model_templates/method_init_normal.mustache delete mode 100644 templates/model_templates/method_init_shared.mustache delete mode 100644 templates/model_templates/method_init_simple.mustache delete mode 100644 templates/model_templates/method_set_attribute.mustache delete mode 100644 templates/model_templates/methods_setattr_getattr_composed.mustache delete mode 100644 templates/model_templates/methods_setattr_getattr_normal.mustache delete mode 100644 templates/model_templates/methods_shared.mustache delete mode 100644 templates/model_templates/methods_todict_tostr_eq_shared.mustache delete mode 100644 templates/model_templates/methods_tostr_eq_simple.mustache delete mode 100644 templates/model_templates/model_composed.mustache delete mode 100644 templates/model_templates/model_normal.mustache delete mode 100644 templates/model_templates/model_simple.mustache delete mode 100644 templates/model_templates/validations.mustache delete mode 100644 templates/model_utils.mustache create mode 100644 templates/partial_api.mustache create mode 100644 templates/partial_api_args.mustache create mode 100644 templates/py.typed.mustache create mode 100644 templates/pyproject.mustache diff --git a/.editorconfig b/.editorconfig index b6637be..9eda130 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,4 +2,4 @@ indent_style = space indent_size = 2 [*.py] -indent_size = 4 \ No newline at end of file +indent_size = 4 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..d7d9ec3 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,38 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: dropbox_sign Python package + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/.gitignore b/.gitignore index 491b708..25f66e0 100644 --- a/.gitignore +++ b/.gitignore @@ -65,4 +65,5 @@ target/ #Ipython Notebook .ipynb_checkpoints +.openapi-generator /vendor diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 237ec22..e038c25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,24 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# # ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml stages: - test -.tests: +.pytest: stage: test script: - pip install -r requirements.txt - pip install -r test-requirements.txt - pytest --cov=dropbox_sign -test-3.6: - extends: .tests - image: python:3.6-alpine -test-3.7: - extends: .tests +pytest-3.7: + extends: .pytest image: python:3.7-alpine -test-3.8: - extends: .tests +pytest-3.8: + extends: .pytest image: python:3.8-alpine -test-3.9: - extends: .tests +pytest-3.9: + extends: .pytest image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 600ecaa..7484ee5 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -21,6 +21,3 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md -git_push.sh -docs/*AllOf* -**/model/*all_of* diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES deleted file mode 100644 index 22b6473..0000000 --- a/.openapi-generator/FILES +++ /dev/null @@ -1,385 +0,0 @@ -.gitignore -.gitlab-ci.yml -.travis.yml -README.md -VERSION -docs/AccountApi.md -docs/AccountCreateRequest.md -docs/AccountCreateResponse.md -docs/AccountGetResponse.md -docs/AccountResponse.md -docs/AccountResponseQuotas.md -docs/AccountResponseUsage.md -docs/AccountUpdateRequest.md -docs/AccountVerifyRequest.md -docs/AccountVerifyResponse.md -docs/AccountVerifyResponseAccount.md -docs/ApiAppApi.md -docs/ApiAppCreateRequest.md -docs/ApiAppGetResponse.md -docs/ApiAppListResponse.md -docs/ApiAppResponse.md -docs/ApiAppResponseOAuth.md -docs/ApiAppResponseOptions.md -docs/ApiAppResponseOwnerAccount.md -docs/ApiAppResponseWhiteLabelingOptions.md -docs/ApiAppUpdateRequest.md -docs/BulkSendJobApi.md -docs/BulkSendJobGetResponse.md -docs/BulkSendJobGetResponseSignatureRequests.md -docs/BulkSendJobListResponse.md -docs/BulkSendJobResponse.md -docs/BulkSendJobSendResponse.md -docs/EmbeddedApi.md -docs/EmbeddedEditUrlRequest.md -docs/EmbeddedEditUrlResponse.md -docs/EmbeddedEditUrlResponseEmbedded.md -docs/EmbeddedSignUrlResponse.md -docs/EmbeddedSignUrlResponseEmbedded.md -docs/ErrorResponse.md -docs/ErrorResponseError.md -docs/EventCallbackRequest.md -docs/EventCallbackRequestEvent.md -docs/EventCallbackRequestEventMetadata.md -docs/FileResponse.md -docs/FileResponseDataUri.md -docs/ListInfoResponse.md -docs/OAuthApi.md -docs/OAuthTokenGenerateRequest.md -docs/OAuthTokenRefreshRequest.md -docs/OAuthTokenResponse.md -docs/ReportApi.md -docs/ReportCreateRequest.md -docs/ReportCreateResponse.md -docs/ReportResponse.md -docs/SignatureRequestApi.md -docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md -docs/SignatureRequestBulkSendWithTemplateRequest.md -docs/SignatureRequestCreateEmbeddedRequest.md -docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md -docs/SignatureRequestGetResponse.md -docs/SignatureRequestListResponse.md -docs/SignatureRequestRemindRequest.md -docs/SignatureRequestResponse.md -docs/SignatureRequestResponseAttachment.md -docs/SignatureRequestResponseCustomFieldBase.md -docs/SignatureRequestResponseCustomFieldCheckbox.md -docs/SignatureRequestResponseCustomFieldText.md -docs/SignatureRequestResponseCustomFieldTypeEnum.md -docs/SignatureRequestResponseDataBase.md -docs/SignatureRequestResponseDataTypeEnum.md -docs/SignatureRequestResponseDataValueCheckbox.md -docs/SignatureRequestResponseDataValueCheckboxMerge.md -docs/SignatureRequestResponseDataValueDateSigned.md -docs/SignatureRequestResponseDataValueDropdown.md -docs/SignatureRequestResponseDataValueInitials.md -docs/SignatureRequestResponseDataValueRadio.md -docs/SignatureRequestResponseDataValueSignature.md -docs/SignatureRequestResponseDataValueText.md -docs/SignatureRequestResponseDataValueTextMerge.md -docs/SignatureRequestResponseSignatures.md -docs/SignatureRequestSendRequest.md -docs/SignatureRequestSendWithTemplateRequest.md -docs/SignatureRequestUpdateRequest.md -docs/SubAttachment.md -docs/SubBulkSignerList.md -docs/SubBulkSignerListCustomField.md -docs/SubCC.md -docs/SubCustomField.md -docs/SubEditorOptions.md -docs/SubFieldOptions.md -docs/SubFormFieldGroup.md -docs/SubFormFieldRule.md -docs/SubFormFieldRuleAction.md -docs/SubFormFieldRuleTrigger.md -docs/SubFormFieldsPerDocumentBase.md -docs/SubFormFieldsPerDocumentCheckbox.md -docs/SubFormFieldsPerDocumentCheckboxMerge.md -docs/SubFormFieldsPerDocumentDateSigned.md -docs/SubFormFieldsPerDocumentDropdown.md -docs/SubFormFieldsPerDocumentFontEnum.md -docs/SubFormFieldsPerDocumentHyperlink.md -docs/SubFormFieldsPerDocumentInitials.md -docs/SubFormFieldsPerDocumentRadio.md -docs/SubFormFieldsPerDocumentSignature.md -docs/SubFormFieldsPerDocumentText.md -docs/SubFormFieldsPerDocumentTextMerge.md -docs/SubFormFieldsPerDocumentTypeEnum.md -docs/SubMergeField.md -docs/SubOAuth.md -docs/SubOptions.md -docs/SubSignatureRequestGroupedSigners.md -docs/SubSignatureRequestSigner.md -docs/SubSignatureRequestTemplateSigner.md -docs/SubSigningOptions.md -docs/SubTeamResponse.md -docs/SubTemplateRole.md -docs/SubUnclaimedDraftSigner.md -docs/SubUnclaimedDraftTemplateSigner.md -docs/SubWhiteLabelingOptions.md -docs/TeamAddMemberRequest.md -docs/TeamApi.md -docs/TeamCreateRequest.md -docs/TeamGetInfoResponse.md -docs/TeamGetResponse.md -docs/TeamInfoResponse.md -docs/TeamInviteResponse.md -docs/TeamInvitesResponse.md -docs/TeamMemberResponse.md -docs/TeamMembersResponse.md -docs/TeamParentResponse.md -docs/TeamRemoveMemberRequest.md -docs/TeamResponse.md -docs/TeamSubTeamsResponse.md -docs/TeamUpdateRequest.md -docs/TemplateAddUserRequest.md -docs/TemplateApi.md -docs/TemplateCreateEmbeddedDraftRequest.md -docs/TemplateCreateEmbeddedDraftResponse.md -docs/TemplateCreateEmbeddedDraftResponseTemplate.md -docs/TemplateCreateRequest.md -docs/TemplateCreateResponse.md -docs/TemplateCreateResponseTemplate.md -docs/TemplateEditResponse.md -docs/TemplateGetResponse.md -docs/TemplateListResponse.md -docs/TemplateRemoveUserRequest.md -docs/TemplateResponse.md -docs/TemplateResponseAccount.md -docs/TemplateResponseAccountQuota.md -docs/TemplateResponseCCRole.md -docs/TemplateResponseDocument.md -docs/TemplateResponseDocumentCustomFieldBase.md -docs/TemplateResponseDocumentCustomFieldCheckbox.md -docs/TemplateResponseDocumentCustomFieldText.md -docs/TemplateResponseDocumentFieldGroup.md -docs/TemplateResponseDocumentFieldGroupRule.md -docs/TemplateResponseDocumentFormFieldBase.md -docs/TemplateResponseDocumentFormFieldCheckbox.md -docs/TemplateResponseDocumentFormFieldDateSigned.md -docs/TemplateResponseDocumentFormFieldDropdown.md -docs/TemplateResponseDocumentFormFieldHyperlink.md -docs/TemplateResponseDocumentFormFieldInitials.md -docs/TemplateResponseDocumentFormFieldRadio.md -docs/TemplateResponseDocumentFormFieldSignature.md -docs/TemplateResponseDocumentFormFieldText.md -docs/TemplateResponseDocumentStaticFieldBase.md -docs/TemplateResponseDocumentStaticFieldCheckbox.md -docs/TemplateResponseDocumentStaticFieldDateSigned.md -docs/TemplateResponseDocumentStaticFieldDropdown.md -docs/TemplateResponseDocumentStaticFieldHyperlink.md -docs/TemplateResponseDocumentStaticFieldInitials.md -docs/TemplateResponseDocumentStaticFieldRadio.md -docs/TemplateResponseDocumentStaticFieldSignature.md -docs/TemplateResponseDocumentStaticFieldText.md -docs/TemplateResponseFieldAvgTextLength.md -docs/TemplateResponseSignerRole.md -docs/TemplateUpdateFilesRequest.md -docs/TemplateUpdateFilesResponse.md -docs/TemplateUpdateFilesResponseTemplate.md -docs/UnclaimedDraftApi.md -docs/UnclaimedDraftCreateEmbeddedRequest.md -docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md -docs/UnclaimedDraftCreateRequest.md -docs/UnclaimedDraftCreateResponse.md -docs/UnclaimedDraftEditAndResendRequest.md -docs/UnclaimedDraftResponse.md -docs/WarningResponse.md -dropbox_sign/__init__.py -dropbox_sign/api/__init__.py -dropbox_sign/api/account_api.py -dropbox_sign/api/api_app_api.py -dropbox_sign/api/bulk_send_job_api.py -dropbox_sign/api/embedded_api.py -dropbox_sign/api/o_auth_api.py -dropbox_sign/api/report_api.py -dropbox_sign/api/signature_request_api.py -dropbox_sign/api/team_api.py -dropbox_sign/api/template_api.py -dropbox_sign/api/unclaimed_draft_api.py -dropbox_sign/api_client.py -dropbox_sign/apis/__init__.py -dropbox_sign/configuration.py -dropbox_sign/event_callback_helper.py -dropbox_sign/exceptions.py -dropbox_sign/model/__init__.py -dropbox_sign/model/account_create_request.py -dropbox_sign/model/account_create_response.py -dropbox_sign/model/account_get_response.py -dropbox_sign/model/account_response.py -dropbox_sign/model/account_response_quotas.py -dropbox_sign/model/account_response_usage.py -dropbox_sign/model/account_update_request.py -dropbox_sign/model/account_verify_request.py -dropbox_sign/model/account_verify_response.py -dropbox_sign/model/account_verify_response_account.py -dropbox_sign/model/api_app_create_request.py -dropbox_sign/model/api_app_get_response.py -dropbox_sign/model/api_app_list_response.py -dropbox_sign/model/api_app_response.py -dropbox_sign/model/api_app_response_o_auth.py -dropbox_sign/model/api_app_response_options.py -dropbox_sign/model/api_app_response_owner_account.py -dropbox_sign/model/api_app_response_white_labeling_options.py -dropbox_sign/model/api_app_update_request.py -dropbox_sign/model/bulk_send_job_get_response.py -dropbox_sign/model/bulk_send_job_get_response_signature_requests.py -dropbox_sign/model/bulk_send_job_list_response.py -dropbox_sign/model/bulk_send_job_response.py -dropbox_sign/model/bulk_send_job_send_response.py -dropbox_sign/model/embedded_edit_url_request.py -dropbox_sign/model/embedded_edit_url_response.py -dropbox_sign/model/embedded_edit_url_response_embedded.py -dropbox_sign/model/embedded_sign_url_response.py -dropbox_sign/model/embedded_sign_url_response_embedded.py -dropbox_sign/model/error_response.py -dropbox_sign/model/error_response_error.py -dropbox_sign/model/event_callback_request.py -dropbox_sign/model/event_callback_request_event.py -dropbox_sign/model/event_callback_request_event_metadata.py -dropbox_sign/model/file_response.py -dropbox_sign/model/file_response_data_uri.py -dropbox_sign/model/list_info_response.py -dropbox_sign/model/o_auth_token_generate_request.py -dropbox_sign/model/o_auth_token_refresh_request.py -dropbox_sign/model/o_auth_token_response.py -dropbox_sign/model/report_create_request.py -dropbox_sign/model/report_create_response.py -dropbox_sign/model/report_response.py -dropbox_sign/model/signature_request_bulk_create_embedded_with_template_request.py -dropbox_sign/model/signature_request_bulk_send_with_template_request.py -dropbox_sign/model/signature_request_create_embedded_request.py -dropbox_sign/model/signature_request_create_embedded_with_template_request.py -dropbox_sign/model/signature_request_get_response.py -dropbox_sign/model/signature_request_list_response.py -dropbox_sign/model/signature_request_remind_request.py -dropbox_sign/model/signature_request_response.py -dropbox_sign/model/signature_request_response_attachment.py -dropbox_sign/model/signature_request_response_custom_field_base.py -dropbox_sign/model/signature_request_response_custom_field_checkbox.py -dropbox_sign/model/signature_request_response_custom_field_text.py -dropbox_sign/model/signature_request_response_custom_field_type_enum.py -dropbox_sign/model/signature_request_response_data_base.py -dropbox_sign/model/signature_request_response_data_type_enum.py -dropbox_sign/model/signature_request_response_data_value_checkbox.py -dropbox_sign/model/signature_request_response_data_value_checkbox_merge.py -dropbox_sign/model/signature_request_response_data_value_date_signed.py -dropbox_sign/model/signature_request_response_data_value_dropdown.py -dropbox_sign/model/signature_request_response_data_value_initials.py -dropbox_sign/model/signature_request_response_data_value_radio.py -dropbox_sign/model/signature_request_response_data_value_signature.py -dropbox_sign/model/signature_request_response_data_value_text.py -dropbox_sign/model/signature_request_response_data_value_text_merge.py -dropbox_sign/model/signature_request_response_signatures.py -dropbox_sign/model/signature_request_send_request.py -dropbox_sign/model/signature_request_send_with_template_request.py -dropbox_sign/model/signature_request_update_request.py -dropbox_sign/model/sub_attachment.py -dropbox_sign/model/sub_bulk_signer_list.py -dropbox_sign/model/sub_bulk_signer_list_custom_field.py -dropbox_sign/model/sub_cc.py -dropbox_sign/model/sub_custom_field.py -dropbox_sign/model/sub_editor_options.py -dropbox_sign/model/sub_field_options.py -dropbox_sign/model/sub_form_field_group.py -dropbox_sign/model/sub_form_field_rule.py -dropbox_sign/model/sub_form_field_rule_action.py -dropbox_sign/model/sub_form_field_rule_trigger.py -dropbox_sign/model/sub_form_fields_per_document_base.py -dropbox_sign/model/sub_form_fields_per_document_checkbox.py -dropbox_sign/model/sub_form_fields_per_document_checkbox_merge.py -dropbox_sign/model/sub_form_fields_per_document_date_signed.py -dropbox_sign/model/sub_form_fields_per_document_dropdown.py -dropbox_sign/model/sub_form_fields_per_document_font_enum.py -dropbox_sign/model/sub_form_fields_per_document_hyperlink.py -dropbox_sign/model/sub_form_fields_per_document_initials.py -dropbox_sign/model/sub_form_fields_per_document_radio.py -dropbox_sign/model/sub_form_fields_per_document_signature.py -dropbox_sign/model/sub_form_fields_per_document_text.py -dropbox_sign/model/sub_form_fields_per_document_text_merge.py -dropbox_sign/model/sub_form_fields_per_document_type_enum.py -dropbox_sign/model/sub_merge_field.py -dropbox_sign/model/sub_o_auth.py -dropbox_sign/model/sub_options.py -dropbox_sign/model/sub_signature_request_grouped_signers.py -dropbox_sign/model/sub_signature_request_signer.py -dropbox_sign/model/sub_signature_request_template_signer.py -dropbox_sign/model/sub_signing_options.py -dropbox_sign/model/sub_team_response.py -dropbox_sign/model/sub_template_role.py -dropbox_sign/model/sub_unclaimed_draft_signer.py -dropbox_sign/model/sub_unclaimed_draft_template_signer.py -dropbox_sign/model/sub_white_labeling_options.py -dropbox_sign/model/team_add_member_request.py -dropbox_sign/model/team_create_request.py -dropbox_sign/model/team_get_info_response.py -dropbox_sign/model/team_get_response.py -dropbox_sign/model/team_info_response.py -dropbox_sign/model/team_invite_response.py -dropbox_sign/model/team_invites_response.py -dropbox_sign/model/team_member_response.py -dropbox_sign/model/team_members_response.py -dropbox_sign/model/team_parent_response.py -dropbox_sign/model/team_remove_member_request.py -dropbox_sign/model/team_response.py -dropbox_sign/model/team_sub_teams_response.py -dropbox_sign/model/team_update_request.py -dropbox_sign/model/template_add_user_request.py -dropbox_sign/model/template_create_embedded_draft_request.py -dropbox_sign/model/template_create_embedded_draft_response.py -dropbox_sign/model/template_create_embedded_draft_response_template.py -dropbox_sign/model/template_create_request.py -dropbox_sign/model/template_create_response.py -dropbox_sign/model/template_create_response_template.py -dropbox_sign/model/template_edit_response.py -dropbox_sign/model/template_get_response.py -dropbox_sign/model/template_list_response.py -dropbox_sign/model/template_remove_user_request.py -dropbox_sign/model/template_response.py -dropbox_sign/model/template_response_account.py -dropbox_sign/model/template_response_account_quota.py -dropbox_sign/model/template_response_cc_role.py -dropbox_sign/model/template_response_document.py -dropbox_sign/model/template_response_document_custom_field_base.py -dropbox_sign/model/template_response_document_custom_field_checkbox.py -dropbox_sign/model/template_response_document_custom_field_text.py -dropbox_sign/model/template_response_document_field_group.py -dropbox_sign/model/template_response_document_field_group_rule.py -dropbox_sign/model/template_response_document_form_field_base.py -dropbox_sign/model/template_response_document_form_field_checkbox.py -dropbox_sign/model/template_response_document_form_field_date_signed.py -dropbox_sign/model/template_response_document_form_field_dropdown.py -dropbox_sign/model/template_response_document_form_field_hyperlink.py -dropbox_sign/model/template_response_document_form_field_initials.py -dropbox_sign/model/template_response_document_form_field_radio.py -dropbox_sign/model/template_response_document_form_field_signature.py -dropbox_sign/model/template_response_document_form_field_text.py -dropbox_sign/model/template_response_document_static_field_base.py -dropbox_sign/model/template_response_document_static_field_checkbox.py -dropbox_sign/model/template_response_document_static_field_date_signed.py -dropbox_sign/model/template_response_document_static_field_dropdown.py -dropbox_sign/model/template_response_document_static_field_hyperlink.py -dropbox_sign/model/template_response_document_static_field_initials.py -dropbox_sign/model/template_response_document_static_field_radio.py -dropbox_sign/model/template_response_document_static_field_signature.py -dropbox_sign/model/template_response_document_static_field_text.py -dropbox_sign/model/template_response_field_avg_text_length.py -dropbox_sign/model/template_response_signer_role.py -dropbox_sign/model/template_update_files_request.py -dropbox_sign/model/template_update_files_response.py -dropbox_sign/model/template_update_files_response_template.py -dropbox_sign/model/unclaimed_draft_create_embedded_request.py -dropbox_sign/model/unclaimed_draft_create_embedded_with_template_request.py -dropbox_sign/model/unclaimed_draft_create_request.py -dropbox_sign/model/unclaimed_draft_create_response.py -dropbox_sign/model/unclaimed_draft_edit_and_resend_request.py -dropbox_sign/model/unclaimed_draft_response.py -dropbox_sign/model/warning_response.py -dropbox_sign/model_utils.py -dropbox_sign/models/__init__.py -dropbox_sign/rest.py -requirements.txt -setup.cfg -setup.py -test-requirements.txt -tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION deleted file mode 100644 index e230c83..0000000 --- a/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.3.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index c40c845..6b47ff2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,14 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.6" - "3.7" - "3.8" - "3.9" + - "3.10" + - "3.11" + # uncomment the following if needed + #- "3.11-dev" # 3.11 development branch + #- "nightly" # nightly build # command to install dependencies install: - "pip install -r requirements.txt" diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 4025343..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (C) 2023 dropbox.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index eb3192e..179a78e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # dropbox-sign - Dropbox Sign v3 API ## Migrating from legacy SDK @@ -43,14 +42,14 @@ this command. ### Requirements. -Python >=3.7 +Python 3.7+ ### pip Install using `pip`: ```shell -python3 -m pip install dropbox-sign==1.5.0 +python3 -m pip install dropbox-sign==1.6.0 ``` Alternatively: @@ -103,8 +102,8 @@ with ApiClient(configuration) as api_client: All URIs are relative to *https://api.hellosign.com/v3* -|Class | Method | HTTP request | Description| -|------------ | ------------- | ------------- | -------------| +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- |```AccountApi``` | [```account_create```](docs/AccountApi.md#account_create) | ```POST /account/create``` | Create Account| ```AccountApi``` | [```account_get```](docs/AccountApi.md#account_get) | ```GET /account``` | Get Account| ```AccountApi``` | [```account_update```](docs/AccountApi.md#account_update) | ```PUT /account``` | Update Account| @@ -118,6 +117,13 @@ All URIs are relative to *https://api.hellosign.com/v3* ```BulkSendJobApi``` | [```bulk_send_job_list```](docs/BulkSendJobApi.md#bulk_send_job_list) | ```GET /bulk_send_job/list``` | List Bulk Send Jobs| |```EmbeddedApi``` | [```embedded_edit_url```](docs/EmbeddedApi.md#embedded_edit_url) | ```POST /embedded/edit_url/{template_id}``` | Get Embedded Template Edit URL| ```EmbeddedApi``` | [```embedded_sign_url```](docs/EmbeddedApi.md#embedded_sign_url) | ```GET /embedded/sign_url/{signature_id}``` | Get Embedded Sign URL| +|```FaxLineApi``` | [```fax_line_add_user```](docs/FaxLineApi.md#fax_line_add_user) | ```PUT /fax_line/add_user``` | Add Fax Line User| +```FaxLineApi``` | [```fax_line_area_code_get```](docs/FaxLineApi.md#fax_line_area_code_get) | ```GET /fax_line/area_codes``` | Get Available Fax Line Area Codes| +```FaxLineApi``` | [```fax_line_create```](docs/FaxLineApi.md#fax_line_create) | ```POST /fax_line/create``` | Purchase Fax Line| +```FaxLineApi``` | [```fax_line_delete```](docs/FaxLineApi.md#fax_line_delete) | ```DELETE /fax_line``` | Delete Fax Line| +```FaxLineApi``` | [```fax_line_get```](docs/FaxLineApi.md#fax_line_get) | ```GET /fax_line``` | Get Fax Line| +```FaxLineApi``` | [```fax_line_list```](docs/FaxLineApi.md#fax_line_list) | ```GET /fax_line/list``` | List Fax Lines| +```FaxLineApi``` | [```fax_line_remove_user```](docs/FaxLineApi.md#fax_line_remove_user) | ```PUT /fax_line/remove_user``` | Remove Fax Line Access| |```OAuthApi``` | [```oauth_token_generate```](docs/OAuthApi.md#oauth_token_generate) | ```POST /oauth/token``` | OAuth Token Generate| ```OAuthApi``` | [```oauth_token_refresh```](docs/OAuthApi.md#oauth_token_refresh) | ```POST /oauth/token?refresh``` | OAuth Token Refresh| |```ReportApi``` | [```report_create```](docs/ReportApi.md#report_create) | ```POST /report/create``` | Create Report| @@ -200,6 +206,17 @@ All URIs are relative to *https://api.hellosign.com/v3* - [EventCallbackRequest](docs/EventCallbackRequest.md) - [EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) + - [FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) + - [FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) + - [FaxLineAreaCodeGetResponse](docs/FaxLineAreaCodeGetResponse.md) + - [FaxLineAreaCodeGetStateEnum](docs/FaxLineAreaCodeGetStateEnum.md) + - [FaxLineCreateRequest](docs/FaxLineCreateRequest.md) + - [FaxLineDeleteRequest](docs/FaxLineDeleteRequest.md) + - [FaxLineListResponse](docs/FaxLineListResponse.md) + - [FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) + - [FaxLineResponse](docs/FaxLineResponse.md) + - [FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) - [FileResponse](docs/FileResponse.md) - [FileResponseDataUri](docs/FileResponseDataUri.md) - [ListInfoResponse](docs/ListInfoResponse.md) @@ -340,15 +357,18 @@ All URIs are relative to *https://api.hellosign.com/v3* - [WarningResponse](docs/WarningResponse.md) + ## Documentation For Authorization -## api_key +Authentication schemes defined for the API: + +### api_key - **Type**: HTTP basic authentication - -## oauth2 + +### oauth2 - **Type**: Bearer authentication (JWT) @@ -363,6 +383,6 @@ apisupport@hellosign.com This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 3.0.0 -- Package version: 1.5.0 +- Package version: 1.6.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen diff --git a/VERSION b/VERSION index bc80560..dc1e644 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.0 +1.6.0 diff --git a/bin/replace b/bin/replace index c5886eb..a9ebab9 100755 --- a/bin/replace +++ b/bin/replace @@ -10,7 +10,6 @@ rep () { REPLACE_STRING=$2 SCAN_DIRS=( \ "docs" \ - "dropbox_sign/model" \ "dropbox_sign/models" \ ) @@ -24,42 +23,6 @@ rep () { done } -perl -pi -e 's/(.*)AllOf.md\)\n//g' "${ROOT_DIR}/README.md" +rep 'Union\[StrictBytes, StrictStr\]' 'Union[StrictBytes, StrictStr, io.IOBase]' -rep '([^\\r\n]+?)from (.*)_all_of import (.*)\n' '' -rep 'from (.*)_all_of import (.*)\n' '' -rep "\s+globals\(\)\['[a-zA-Z]+AllOf(.*)\n" '' - -# def bulk_send_job_id(self) -> str, none_type: -# def bulk_send_job_id(self) -> Optional[str]: -rep 'def ([a-zA-Z_]+)\(self\) -> (.*), none_type:' 'def $1(self) -> Optional[$2]:' - -# def bulk_send_job_id(self, value: str, none_type): -# def bulk_send_job_id(self, value: Optional[str]): -rep 'def ([a-zA-Z_]+)\(self, value: (.*), none_type\):' 'def $1(self, value: Optional[$2]):' - -# def bulk_send_jobs(self) -> [BulkSendJobResponse]: -# def bulk_send_jobs(self) -> List[BulkSendJobResponse]: -rep 'def ([a-zA-Z_]+)\(self\) -> \[(.*)\]:' 'def $1(self) -> List[$2]:' - -# def bulk_send_jobs(self, value: [BulkSendJobResponse]): -# def bulk_send_jobs(self, value: List[BulkSendJobResponse]): -rep 'def ([a-zA-Z_]+)\(self, value: \[(.*)\]\):' 'def $1(self, value: List[$2]):' - -# def template_ids(self) -> Optional[[str]]: -# def template_ids(self) -> Optional[List[str]]: -rep 'def ([a-zA-Z_]+)\(self\) -> ([a-zA-Z]+)\[\[(.*)\]\]:' 'def $1(self) -> $2\[List[$3]]:' - -# def template_ids(self, value: Optional[[str]]): -# def template_ids(self, value: Optional[List[str]]): -rep 'def ([a-zA-Z_]+)\(self, value: ([a-zA-Z]+)\[\[(.*)\]\]\):' 'def $1(self, value: $2\[List[$3]]):' - -# def metadata(self) -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)}: -# def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: -rep 'def ([a-zA-Z_]+)\(self\) -> \{([a-zA-Z]+): \((.*)\)\}:' 'def $1(self) -> Dict[$2, Union[$3]]:' - -# def metadata(self, value: {str: (bool, date, datetime, dict, float, int, list, str, none_type)}): -# def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): -rep 'def ([a-zA-Z_]+)\(self\, value: \{([a-zA-Z]+): \((.*)\)\}\):' 'def $1(self, value: Dict[$2, Union[$3]]):' - -printf "\n" \ No newline at end of file +printf "\n" diff --git a/bin/scan_for b/bin/scan_for index d98afe8..cb16e0a 100755 --- a/bin/scan_for +++ b/bin/scan_for @@ -9,7 +9,6 @@ scan_for () { SEARCH_STRING=$1 SCAN_TARGETS=( \ "docs" \ - "dropbox_sign/model" \ "dropbox_sign/models" \ "README.md" ) diff --git a/docs/AccountApi.md b/docs/AccountApi.md index 4622cea..7735844 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```account_create```](AccountApi.md#account_create) | ```POST /account/create``` | Create Account| |[```account_get```](AccountApi.md#account_get) | ```GET /account``` | Get Account| |[```account_update```](AccountApi.md#account_update) | ```PUT /account``` | Update Account| @@ -50,10 +50,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_create_request` | [**AccountCreateRequest**](AccountCreateRequest.md) | | | @@ -71,7 +70,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -117,10 +115,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_id` | **str** | `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. | [optional] | @@ -139,7 +136,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -189,10 +185,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_update_request` | [**AccountUpdateRequest**](AccountUpdateRequest.md) | | | @@ -210,7 +205,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -260,10 +254,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_verify_request` | [**AccountVerifyRequest**](AccountVerifyRequest.md) | | | @@ -281,7 +274,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/AccountCreateRequest.md b/docs/AccountCreateRequest.md index 6a2c349..a804661 100644 --- a/docs/AccountCreateRequest.md +++ b/docs/AccountCreateRequest.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address`*_required_ | ```str``` | The email address which will be associated with the new Account. | | | `client_id` | ```str``` | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | | | `client_secret` | ```str``` | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | | | `locale` | ```str``` | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountCreateResponse.md b/docs/AccountCreateResponse.md index 7e6fcca..9b1be12 100644 --- a/docs/AccountCreateResponse.md +++ b/docs/AccountCreateResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `account` | [```AccountResponse```](AccountResponse.md) | | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | | `oauth_data` | [```OAuthTokenResponse```](OAuthTokenResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountGetResponse.md b/docs/AccountGetResponse.md index 3367166..0c12540 100644 --- a/docs/AccountGetResponse.md +++ b/docs/AccountGetResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `account` | [```AccountResponse```](AccountResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `account`*_required_ | [```AccountResponse```](AccountResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountResponse.md b/docs/AccountResponse.md index cf55526..26ce76b 100644 --- a/docs/AccountResponse.md +++ b/docs/AccountResponse.md @@ -3,22 +3,19 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | The ID of the Account | | | `email_address` | ```str``` | The email address associated with the Account. | | | `is_locked` | ```bool``` | Returns `true` if the user has been locked out of their account by a team admin. | | | `is_paid_hs` | ```bool``` | Returns `true` if the user has a paid Dropbox Sign account. | | | `is_paid_hf` | ```bool``` | Returns `true` if the user has a paid HelloFax account. | | | `quotas` | [```AccountResponseQuotas```](AccountResponseQuotas.md) | | | -| `callback_url` | ```str, none_type``` | The URL that Dropbox Sign events will `POST` to. | | -| `role_code` | ```str, none_type``` | The membership role for the team. | | -| `team_id` | ```str, none_type``` | The id of the team account belongs to. | | -| `locale` | ```str, none_type``` | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | | +| `callback_url` | ```str``` | The URL that Dropbox Sign events will `POST` to. | | +| `role_code` | ```str``` | The membership role for the team. | | +| `team_id` | ```str``` | The id of the team account belongs to. | | +| `locale` | ```str``` | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | | | `usage` | [```AccountResponseUsage```](AccountResponseUsage.md) | | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountResponseQuotas.md b/docs/AccountResponseQuotas.md index bdf6974..740ad23 100644 --- a/docs/AccountResponseQuotas.md +++ b/docs/AccountResponseQuotas.md @@ -3,17 +3,14 @@ Details concerning remaining monthly quotas. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `api_signature_requests_left` | ```int, none_type``` | API signature requests remaining. | | -| `documents_left` | ```int, none_type``` | Signature requests remaining. | | -| `templates_total` | ```int, none_type``` | Total API templates allowed. | | -| `templates_left` | ```int, none_type``` | API templates remaining. | | -| `sms_verifications_left` | ```int, none_type``` | SMS verifications remaining. | | -| `num_fax_pages_left` | ```int, none_type``` | Number of fax pages left | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `api_signature_requests_left` | ```int``` | API signature requests remaining. | | +| `documents_left` | ```int``` | Signature requests remaining. | | +| `templates_total` | ```int``` | Total API templates allowed. | | +| `templates_left` | ```int``` | API templates remaining. | | +| `sms_verifications_left` | ```int``` | SMS verifications remaining. | | +| `num_fax_pages_left` | ```int``` | Number of fax pages left | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountResponseUsage.md b/docs/AccountResponseUsage.md index e6e51d2..dd99429 100644 --- a/docs/AccountResponseUsage.md +++ b/docs/AccountResponseUsage.md @@ -3,12 +3,9 @@ Details concerning monthly usage ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `fax_pages_sent` | ```int, none_type``` | Number of fax pages sent | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax_pages_sent` | ```int``` | Number of fax pages sent | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountUpdateRequest.md b/docs/AccountUpdateRequest.md index 0d76f5c..5ef47eb 100644 --- a/docs/AccountUpdateRequest.md +++ b/docs/AccountUpdateRequest.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `account_id` | ```str, none_type``` | The ID of the Account | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `account_id` | ```str``` | The ID of the Account | | | `callback_url` | ```str``` | The URL that Dropbox Sign should POST events to. | | | `locale` | ```str``` | The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountVerifyRequest.md b/docs/AccountVerifyRequest.md index 946859e..9dc6f46 100644 --- a/docs/AccountVerifyRequest.md +++ b/docs/AccountVerifyRequest.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address`*_required_ | ```str``` | Email address to run the verification for. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountVerifyResponse.md b/docs/AccountVerifyResponse.md index cde5fdd..2f0c541 100644 --- a/docs/AccountVerifyResponse.md +++ b/docs/AccountVerifyResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account` | [```AccountVerifyResponseAccount```](AccountVerifyResponseAccount.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountVerifyResponseAccount.md b/docs/AccountVerifyResponseAccount.md index b9359ab..9c4abee 100644 --- a/docs/AccountVerifyResponseAccount.md +++ b/docs/AccountVerifyResponseAccount.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address` | ```str``` | The email address associated with the Account. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ApiAppApi.md b/docs/ApiAppApi.md index 7453340..0245512 100644 --- a/docs/ApiAppApi.md +++ b/docs/ApiAppApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```api_app_create```](ApiAppApi.md#api_app_create) | ```POST /api_app``` | Create API App| |[```api_app_delete```](ApiAppApi.md#api_app_delete) | ```DELETE /api_app/{client_id}``` | Delete API App| |[```api_app_get```](ApiAppApi.md#api_app_get) | ```GET /api_app/{client_id}``` | Get API App| @@ -67,10 +67,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `api_app_create_request` | [**ApiAppCreateRequest**](ApiAppCreateRequest.md) | | | @@ -88,7 +87,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -133,10 +131,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `client_id` | **str** | The client id of the API App to delete. | | @@ -154,7 +151,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -202,10 +198,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `client_id` | **str** | The client id of the API App to retrieve. | | @@ -223,7 +218,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -275,10 +269,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `page` | **int** | Which page number of the API App List to return. Defaults to `1`. | [optional][default to 1] | @@ -297,7 +290,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -359,10 +351,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `client_id` | **str** | The client id of the API App to update. | | @@ -381,7 +372,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/ApiAppCreateRequest.md b/docs/ApiAppCreateRequest.md index 4e9fe09..9cac62a 100644 --- a/docs/ApiAppCreateRequest.md +++ b/docs/ApiAppCreateRequest.md @@ -3,18 +3,15 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `domains`*_required_ | ```[str]``` | The domain names the ApiApp will be associated with. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `domains`*_required_ | ```List[str]``` | The domain names the ApiApp will be associated with. | | | `name`*_required_ | ```str``` | The name you want to assign to the ApiApp. | | | `callback_url` | ```str``` | The URL at which the ApiApp should receive event callbacks. | | -| `custom_logo_file` | ```file_type``` | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | | +| `custom_logo_file` | ```io.IOBase``` | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | | | `oauth` | [```SubOAuth```](SubOAuth.md) | | | | `options` | [```SubOptions```](SubOptions.md) | | | | `white_labeling_options` | [```SubWhiteLabelingOptions```](SubWhiteLabelingOptions.md) | | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ApiAppGetResponse.md b/docs/ApiAppGetResponse.md index fabf32f..7d45c86 100644 --- a/docs/ApiAppGetResponse.md +++ b/docs/ApiAppGetResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `api_app` | [```ApiAppResponse```](ApiAppResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `api_app`*_required_ | [```ApiAppResponse```](ApiAppResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ApiAppListResponse.md b/docs/ApiAppListResponse.md index 964bcbc..b41af4e 100644 --- a/docs/ApiAppListResponse.md +++ b/docs/ApiAppListResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `api_apps` | [```[ApiAppResponse]```](ApiAppResponse.md) | Contains information about API Apps. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `api_apps`*_required_ | [```List[ApiAppResponse]```](ApiAppResponse.md) | Contains information about API Apps. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ApiAppResponse.md b/docs/ApiAppResponse.md index 5a7a14f..ae25a38 100644 --- a/docs/ApiAppResponse.md +++ b/docs/ApiAppResponse.md @@ -3,13 +3,12 @@ Contains information about an API App. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `callback_url` | ```str, none_type``` | The app's callback URL (for events) | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `callback_url` | ```str``` | The app's callback URL (for events) | | | `client_id` | ```str``` | The app's client id | | | `created_at` | ```int``` | The time that the app was created | | -| `domains` | ```[str]``` | The domain name(s) associated with the app | | +| `domains` | ```List[str]``` | The domain name(s) associated with the app | | | `name` | ```str``` | The name of the app | | | `is_approved` | ```bool``` | Boolean to indicate if the app has been approved | | | `oauth` | [```ApiAppResponseOAuth```](ApiAppResponseOAuth.md) | | | @@ -17,7 +16,5 @@ Contains information about an API App. | `owner_account` | [```ApiAppResponseOwnerAccount```](ApiAppResponseOwnerAccount.md) | | | | `white_labeling_options` | [```ApiAppResponseWhiteLabelingOptions```](ApiAppResponseWhiteLabelingOptions.md) | | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ApiAppResponseOAuth.md b/docs/ApiAppResponseOAuth.md index 2f3f281..0c18e5f 100644 --- a/docs/ApiAppResponseOAuth.md +++ b/docs/ApiAppResponseOAuth.md @@ -3,15 +3,12 @@ An object describing the app's OAuth properties, or null if OAuth is not configured for the app. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `callback_url` | ```str``` | The app's OAuth callback URL. | | | `secret` | ```str``` | The app's OAuth secret, or null if the app does not belong to user. | | -| `scopes` | ```[str]``` | Array of OAuth scopes used by the app. | | +| `scopes` | ```List[str]``` | Array of OAuth scopes used by the app. | | | `charges_users` | ```bool``` | Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ApiAppResponseOptions.md b/docs/ApiAppResponseOptions.md index d97398f..42f8144 100644 --- a/docs/ApiAppResponseOptions.md +++ b/docs/ApiAppResponseOptions.md @@ -3,12 +3,9 @@ An object with options that override account settings. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `can_insert_everywhere` | ```bool``` | Boolean denoting if signers can "Insert Everywhere" in one click while signing a document | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ApiAppResponseOwnerAccount.md b/docs/ApiAppResponseOwnerAccount.md index a15eaa2..9b8e22f 100644 --- a/docs/ApiAppResponseOwnerAccount.md +++ b/docs/ApiAppResponseOwnerAccount.md @@ -3,13 +3,10 @@ An object describing the app's owner ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | The owner account's ID | | | `email_address` | ```str``` | The owner account's email address | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ApiAppResponseWhiteLabelingOptions.md b/docs/ApiAppResponseWhiteLabelingOptions.md index eca2484..375c8f2 100644 --- a/docs/ApiAppResponseWhiteLabelingOptions.md +++ b/docs/ApiAppResponseWhiteLabelingOptions.md @@ -3,9 +3,8 @@ An object with options to customize the app's signer page ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `header_background_color` | ```str``` | | | | `legal_version` | ```str``` | | | | `link_color` | ```str``` | | | @@ -21,7 +20,5 @@ An object with options to customize the app's signer page | `text_color1` | ```str``` | | | | `text_color2` | ```str``` | | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ApiAppUpdateRequest.md b/docs/ApiAppUpdateRequest.md index e2cfaf7..6e3238a 100644 --- a/docs/ApiAppUpdateRequest.md +++ b/docs/ApiAppUpdateRequest.md @@ -3,18 +3,15 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `callback_url` | ```str``` | The URL at which the API App should receive event callbacks. | | -| `custom_logo_file` | ```file_type``` | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | | -| `domains` | ```[str]``` | The domain names the ApiApp will be associated with. | | +| `custom_logo_file` | ```io.IOBase``` | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | | +| `domains` | ```List[str]``` | The domain names the ApiApp will be associated with. | | | `name` | ```str``` | The name you want to assign to the ApiApp. | | | `oauth` | [```SubOAuth```](SubOAuth.md) | | | | `options` | [```SubOptions```](SubOptions.md) | | | | `white_labeling_options` | [```SubWhiteLabelingOptions```](SubWhiteLabelingOptions.md) | | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BulkSendJobApi.md b/docs/BulkSendJobApi.md index ef5f437..fce689b 100644 --- a/docs/BulkSendJobApi.md +++ b/docs/BulkSendJobApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```bulk_send_job_get```](BulkSendJobApi.md#bulk_send_job_get) | ```GET /bulk_send_job/{bulk_send_job_id}``` | Get Bulk Send Job| |[```bulk_send_job_list```](BulkSendJobApi.md#bulk_send_job_list) | ```GET /bulk_send_job/list``` | List Bulk Send Jobs| @@ -46,10 +46,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `bulk_send_job_id` | **str** | The id of the BulkSendJob to retrieve. | | @@ -69,7 +68,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -121,10 +119,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `page` | **int** | Which page number of the BulkSendJob List to return. Defaults to `1`. | [optional][default to 1] | @@ -143,7 +140,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/BulkSendJobGetResponse.md b/docs/BulkSendJobGetResponse.md index 3718a39..a39bcb8 100644 --- a/docs/BulkSendJobGetResponse.md +++ b/docs/BulkSendJobGetResponse.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `bulk_send_job` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `signature_requests` | [```[BulkSendJobGetResponseSignatureRequests]```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `bulk_send_job`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `signature_requests`*_required_ | [```List[BulkSendJobGetResponseSignatureRequests]```](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BulkSendJobGetResponseSignatureRequests.md b/docs/BulkSendJobGetResponseSignatureRequests.md index 660eb81..d213ed9 100644 --- a/docs/BulkSendJobGetResponseSignatureRequests.md +++ b/docs/BulkSendJobGetResponseSignatureRequests.md @@ -3,36 +3,33 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `test_mode` | ```bool, none_type``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [default to False] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `test_mode` | ```bool``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [default to False] | | `signature_request_id` | ```str``` | The id of the SignatureRequest. | | | `requester_email_address` | ```str``` | The email address of the initiator of the SignatureRequest. | | | `title` | ```str``` | The title the specified Account uses for the SignatureRequest. | | | `original_title` | ```str``` | Default Label for account. | | -| `subject` | ```str, none_type``` | The subject in the email that was initially sent to the signers. | | -| `message` | ```str, none_type``` | The custom message in the email that was initially sent to the signers. | | -| `metadata` | [```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}```](.md) | The metadata attached to the signature request. | | +| `subject` | ```str``` | The subject in the email that was initially sent to the signers. | | +| `message` | ```str``` | The custom message in the email that was initially sent to the signers. | | +| `metadata` | ```object``` | The metadata attached to the signature request. | | | `created_at` | ```int``` | Time the signature request was created. | | | `expires_at` | ```int``` | The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | | `is_complete` | ```bool``` | Whether or not the SignatureRequest has been fully executed by all signers. | | | `is_declined` | ```bool``` | Whether or not the SignatureRequest has been declined by a signer. | | | `has_error` | ```bool``` | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | | | `files_url` | ```str``` | The URL where a copy of the request's documents can be downloaded. | | -| `signing_url` | ```str, none_type``` | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | | +| `signing_url` | ```str``` | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | | | `details_url` | ```str``` | The URL where the requester and the signers can view the current status of the SignatureRequest. | | -| `cc_email_addresses` | ```[str]``` | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | | -| `signing_redirect_url` | ```str, none_type``` | The URL you want the signer redirected to after they successfully sign. | | -| `final_copy_uri` | ```str, none_type``` | The path where the completed document can be downloaded | | -| `template_ids` | ```[str], none_type``` | Templates IDs used in this SignatureRequest (if any). | | -| `custom_fields` | [```[SignatureRequestResponseCustomFieldBase], none_type```](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | | -| `attachments` | [```[SignatureRequestResponseAttachment], none_type```](SignatureRequestResponseAttachment.md) | Signer attachments. | | -| `response_data` | [```[SignatureRequestResponseDataBase], none_type```](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | | -| `signatures` | [```[SignatureRequestResponseSignatures]```](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | | +| `cc_email_addresses` | ```List[str]``` | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | | +| `signing_redirect_url` | ```str``` | The URL you want the signer redirected to after they successfully sign. | | +| `final_copy_uri` | ```str``` | The path where the completed document can be downloaded | | +| `template_ids` | ```List[str]``` | Templates IDs used in this SignatureRequest (if any). | | +| `custom_fields` | [```List[SignatureRequestResponseCustomFieldBase]```](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | | +| `attachments` | [```List[SignatureRequestResponseAttachment]```](SignatureRequestResponseAttachment.md) | Signer attachments. | | +| `response_data` | [```List[SignatureRequestResponseDataBase]```](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | | +| `signatures` | [```List[SignatureRequestResponseSignatures]```](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | | | `bulk_send_job_id` | ```str``` | The id of the BulkSendJob. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BulkSendJobListResponse.md b/docs/BulkSendJobListResponse.md index ef64fd8..24c7abc 100644 --- a/docs/BulkSendJobListResponse.md +++ b/docs/BulkSendJobListResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `bulk_send_jobs` | [```[BulkSendJobResponse]```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `bulk_send_jobs`*_required_ | [```List[BulkSendJobResponse]```](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BulkSendJobResponse.md b/docs/BulkSendJobResponse.md index eca78a4..19e770f 100644 --- a/docs/BulkSendJobResponse.md +++ b/docs/BulkSendJobResponse.md @@ -3,15 +3,12 @@ Contains information about the BulkSendJob such as when it was created and how many signature requests are queued. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `bulk_send_job_id` | ```str, none_type``` | The id of the BulkSendJob. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `bulk_send_job_id` | ```str``` | The id of the BulkSendJob. | | | `total` | ```int``` | The total amount of Signature Requests queued for sending. | | | `is_creator` | ```bool``` | True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. | | | `created_at` | ```int``` | Time that the BulkSendJob was created. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BulkSendJobSendResponse.md b/docs/BulkSendJobSendResponse.md index 2dd2d47..cf31a57 100644 --- a/docs/BulkSendJobSendResponse.md +++ b/docs/BulkSendJobSendResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `bulk_send_job` | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `bulk_send_job`*_required_ | [```BulkSendJobResponse```](BulkSendJobResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/EmbeddedApi.md b/docs/EmbeddedApi.md index 3c53b02..c581d14 100644 --- a/docs/EmbeddedApi.md +++ b/docs/EmbeddedApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```embedded_edit_url```](EmbeddedApi.md#embedded_edit_url) | ```POST /embedded/edit_url/{template_id}``` | Get Embedded Template Edit URL| |[```embedded_sign_url```](EmbeddedApi.md#embedded_sign_url) | ```GET /embedded/sign_url/{signature_id}``` | Get Embedded Sign URL| @@ -51,10 +51,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the template to edit. | | @@ -73,7 +72,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -121,10 +119,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_id` | **str** | The id of the signature to get a signature url for. | | @@ -142,7 +139,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/EmbeddedEditUrlRequest.md b/docs/EmbeddedEditUrlRequest.md index 47d4284..6382a52 100644 --- a/docs/EmbeddedEditUrlRequest.md +++ b/docs/EmbeddedEditUrlRequest.md @@ -3,21 +3,18 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `allow_edit_ccs` | ```bool``` | This allows the requester to enable/disable to add or change CC roles when editing the template. | [default to False] | -| `cc_roles` | ```[str]``` | The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. | | +| `cc_roles` | ```List[str]``` | The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request. | | | `editor_options` | [```SubEditorOptions```](SubEditorOptions.md) | | | | `force_signer_roles` | ```bool``` | Provide users the ability to review/edit the template signer roles. | [default to False] | | `force_subject_message` | ```bool``` | Provide users the ability to review/edit the template subject and message. | [default to False] | -| `merge_fields` | [```[SubMergeField]```](SubMergeField.md) | Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template.

Remove all merge fields on the template by passing an empty array `[]`. | | +| `merge_fields` | [```List[SubMergeField]```](SubMergeField.md) | Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template.

Remove all merge fields on the template by passing an empty array `[]`. | | | `preview_only` | ```bool``` | This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor).

**NOTE:** This parameter overwrites `show_preview=true` (if set). | [default to False] | | `show_preview` | ```bool``` | This allows the requester to enable the editor/preview experience. | [default to False] | | `show_progress_stepper` | ```bool``` | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [default to True] | | `test_mode` | ```bool``` | Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/EmbeddedEditUrlResponse.md b/docs/EmbeddedEditUrlResponse.md index aef313b..e1f5781 100644 --- a/docs/EmbeddedEditUrlResponse.md +++ b/docs/EmbeddedEditUrlResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `embedded` | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `embedded`*_required_ | [```EmbeddedEditUrlResponseEmbedded```](EmbeddedEditUrlResponseEmbedded.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/EmbeddedEditUrlResponseEmbedded.md b/docs/EmbeddedEditUrlResponseEmbedded.md index e00f675..ae39687 100644 --- a/docs/EmbeddedEditUrlResponseEmbedded.md +++ b/docs/EmbeddedEditUrlResponseEmbedded.md @@ -3,13 +3,10 @@ An embedded template object. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `edit_url` | ```str``` | A template url that can be opened in an iFrame. | | | `expires_at` | ```int``` | The specific time that the the `edit_url` link expires, in epoch. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/EmbeddedSignUrlResponse.md b/docs/EmbeddedSignUrlResponse.md index 307dc7d..af38fc7 100644 --- a/docs/EmbeddedSignUrlResponse.md +++ b/docs/EmbeddedSignUrlResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `embedded` | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `embedded`*_required_ | [```EmbeddedSignUrlResponseEmbedded```](EmbeddedSignUrlResponseEmbedded.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/EmbeddedSignUrlResponseEmbedded.md b/docs/EmbeddedSignUrlResponseEmbedded.md index 098e46c..71373c8 100644 --- a/docs/EmbeddedSignUrlResponseEmbedded.md +++ b/docs/EmbeddedSignUrlResponseEmbedded.md @@ -3,13 +3,10 @@ An object that contains necessary information to set up embedded signing. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `sign_url` | ```str``` | A signature url that can be opened in an iFrame. | | | `expires_at` | ```int``` | The specific time that the the `sign_url` link expires, in epoch. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md index 9235a71..dc83b8f 100644 --- a/docs/ErrorResponse.md +++ b/docs/ErrorResponse.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `error`*_required_ | [```ErrorResponseError```](ErrorResponseError.md) | | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ErrorResponseError.md b/docs/ErrorResponseError.md index d686a1f..9b05890 100644 --- a/docs/ErrorResponseError.md +++ b/docs/ErrorResponseError.md @@ -3,14 +3,11 @@ Contains information about an error that occurred. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `error_msg`*_required_ | ```str``` | Message describing an error. | | | `error_name`*_required_ | ```str``` | Name of the error. | | | `error_path` | ```str``` | Path at which an error occurred. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/EventCallbackRequest.md b/docs/EventCallbackRequest.md index 6e3f73a..857fac5 100644 --- a/docs/EventCallbackRequest.md +++ b/docs/EventCallbackRequest.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `event`*_required_ | [```EventCallbackRequestEvent```](EventCallbackRequestEvent.md) | | | | `account` | [```AccountResponse```](AccountResponse.md) | | | | `signature_request` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | | `template` | [```TemplateResponse```](TemplateResponse.md) | | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/EventCallbackRequestEvent.md b/docs/EventCallbackRequestEvent.md index d658d01..6eadfcd 100644 --- a/docs/EventCallbackRequestEvent.md +++ b/docs/EventCallbackRequestEvent.md @@ -3,15 +3,12 @@ Basic information about the event that occurred. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `event_time`*_required_ | ```str``` | Time the event was created (using Unix time). | | | `event_type`*_required_ | ```str``` | Type of callback event that was triggered. | | | `event_hash`*_required_ | ```str``` | Generated hash used to verify source of event data. | | | `event_metadata` | [```EventCallbackRequestEventMetadata```](EventCallbackRequestEventMetadata.md) | | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/EventCallbackRequestEventMetadata.md b/docs/EventCallbackRequestEventMetadata.md index 9de3e33..d510eae 100644 --- a/docs/EventCallbackRequestEventMetadata.md +++ b/docs/EventCallbackRequestEventMetadata.md @@ -3,15 +3,12 @@ Specific metadata about the event. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `related_signature_id` | ```str, none_type``` | Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. | | -| `reported_for_account_id` | ```str, none_type``` | Account ID the event was reported for. | | -| `reported_for_app_id` | ```str, none_type``` | App ID the event was reported for. | | -| `event_message` | ```str, none_type``` | Message about a declined or failed (due to error) signature flow. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `related_signature_id` | ```str``` | Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. | | +| `reported_for_account_id` | ```str``` | Account ID the event was reported for. | | +| `reported_for_app_id` | ```str``` | App ID the event was reported for. | | +| `event_message` | ```str``` | Message about a declined or failed (due to error) signature flow. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/FaxLineAddUserRequest.md b/docs/FaxLineAddUserRequest.md new file mode 100644 index 0000000..9d2c5e1 --- /dev/null +++ b/docs/FaxLineAddUserRequest.md @@ -0,0 +1,13 @@ +# FaxLineAddUserRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```str``` | The Fax Line number. | | +| `account_id` | ```str``` | Account ID | | +| `email_address` | ```str``` | Email address | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FaxLineApi.md b/docs/FaxLineApi.md new file mode 100644 index 0000000..e9260af --- /dev/null +++ b/docs/FaxLineApi.md @@ -0,0 +1,466 @@ +# ```dropbox_sign.FaxLineApi``` + +All URIs are relative to *https://api.hellosign.com/v3* + +Method | HTTP request | Description +------------- | ------------- | ------------- +|[```fax_line_add_user```](FaxLineApi.md#fax_line_add_user) | ```PUT /fax_line/add_user``` | Add Fax Line User| +|[```fax_line_area_code_get```](FaxLineApi.md#fax_line_area_code_get) | ```GET /fax_line/area_codes``` | Get Available Fax Line Area Codes| +|[```fax_line_create```](FaxLineApi.md#fax_line_create) | ```POST /fax_line/create``` | Purchase Fax Line| +|[```fax_line_delete```](FaxLineApi.md#fax_line_delete) | ```DELETE /fax_line``` | Delete Fax Line| +|[```fax_line_get```](FaxLineApi.md#fax_line_get) | ```GET /fax_line``` | Get Fax Line| +|[```fax_line_list```](FaxLineApi.md#fax_line_list) | ```GET /fax_line/list``` | List Fax Lines| +|[```fax_line_remove_user```](FaxLineApi.md#fax_line_remove_user) | ```PUT /fax_line/remove_user``` | Remove Fax Line Access| + + +# ```fax_line_add_user``` +> ```FaxLineResponse fax_line_add_user(fax_line_add_user_request)``` + +Add Fax Line User + +Grants a user access to the specified Fax Line. + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineAddUserRequest( + number="[FAX_NUMBER]", + email_address="member@dropboxsign.com", + ) + + try: + response = fax_line_api.fax_line_add_user(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_add_user_request` | [**FaxLineAddUserRequest**](FaxLineAddUserRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```fax_line_area_code_get``` +> ```FaxLineAreaCodeGetResponse fax_line_area_code_get(country)``` + +Get Available Fax Line Area Codes + +Returns a response with the area codes available for a given state/provice and city. + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_area_code_get("US", "CA") + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `country` | **str** | Filter area codes by country. | | +| `state` | **str** | Filter area codes by state. | [optional] | +| `province` | **str** | Filter area codes by province. | [optional] | +| `city` | **str** | Filter area codes by city. | [optional] | + +### Return type + +[**FaxLineAreaCodeGetResponse**](FaxLineAreaCodeGetResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```fax_line_create``` +> ```FaxLineResponse fax_line_create(fax_line_create_request)``` + +Purchase Fax Line + +Purchases a new Fax Line. + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineCreateRequest( + area_code=209, + country="US", + ) + + try: + response = fax_line_api.fax_line_create(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_create_request` | [**FaxLineCreateRequest**](FaxLineCreateRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```fax_line_delete``` +> ```fax_line_delete(fax_line_delete_request)``` + +Delete Fax Line + +Deletes the specified Fax Line from the subscription. + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineDeleteRequest( + number="[FAX_NUMBER]", + ) + + try: + fax_line_api.fax_line_delete(data) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_delete_request` | [**FaxLineDeleteRequest**](FaxLineDeleteRequest.md) | | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```fax_line_get``` +> ```FaxLineResponse fax_line_get(number)``` + +Get Fax Line + +Returns the properties and settings of a Fax Line. + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_get("[FAX_NUMBER]") + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `number` | **str** | The Fax Line number. | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```fax_line_list``` +> ```FaxLineListResponse fax_line_list()``` + +List Fax Lines + +Returns the properties and settings of multiple Fax Lines. + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_list() + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `account_id` | **str** | Account ID | [optional] | +| `page` | **int** | Page | [optional][default to 1] | +| `page_size` | **int** | Page size | [optional][default to 20] | +| `show_team_lines` | **bool** | Show team lines | [optional] | + +### Return type + +[**FaxLineListResponse**](FaxLineListResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# ```fax_line_remove_user``` +> ```FaxLineResponse fax_line_remove_user(fax_line_remove_user_request)``` + +Remove Fax Line Access + +Removes a user's access to the specified Fax Line. + +### Example + +* Basic Authentication (api_key): + +```python +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineRemoveUserRequest( + number="[FAX_NUMBER]", + email_address="member@dropboxsign.com", + ) + + try: + response = fax_line_api.fax_line_remove_user(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) + +``` +``` + +### Parameters +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| `fax_line_remove_user_request` | [**FaxLineRemoveUserRequest**](FaxLineRemoveUserRequest.md) | | | + +### Return type + +[**FaxLineResponse**](FaxLineResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-Ratelimit-Reset -
| +**4XX** | failed_operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/FaxLineAreaCodeGetCountryEnum.md b/docs/FaxLineAreaCodeGetCountryEnum.md new file mode 100644 index 0000000..6ad763e --- /dev/null +++ b/docs/FaxLineAreaCodeGetCountryEnum.md @@ -0,0 +1,10 @@ +# FaxLineAreaCodeGetCountryEnum + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FaxLineAreaCodeGetProvinceEnum.md b/docs/FaxLineAreaCodeGetProvinceEnum.md new file mode 100644 index 0000000..71e2411 --- /dev/null +++ b/docs/FaxLineAreaCodeGetProvinceEnum.md @@ -0,0 +1,10 @@ +# FaxLineAreaCodeGetProvinceEnum + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FaxLineAreaCodeGetResponse.md b/docs/FaxLineAreaCodeGetResponse.md new file mode 100644 index 0000000..b7fc28c --- /dev/null +++ b/docs/FaxLineAreaCodeGetResponse.md @@ -0,0 +1,11 @@ +# FaxLineAreaCodeGetResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `area_codes`*_required_ | ```List[int]``` | | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FaxLineAreaCodeGetStateEnum.md b/docs/FaxLineAreaCodeGetStateEnum.md new file mode 100644 index 0000000..d62ba3a --- /dev/null +++ b/docs/FaxLineAreaCodeGetStateEnum.md @@ -0,0 +1,10 @@ +# FaxLineAreaCodeGetStateEnum + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FaxLineCreateRequest.md b/docs/FaxLineCreateRequest.md new file mode 100644 index 0000000..b6b33b3 --- /dev/null +++ b/docs/FaxLineCreateRequest.md @@ -0,0 +1,14 @@ +# FaxLineCreateRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `area_code`*_required_ | ```int``` | Area code | | +| `country`*_required_ | ```str``` | Country | | +| `city` | ```str``` | City | | +| `account_id` | ```str``` | Account ID | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FaxLineDeleteRequest.md b/docs/FaxLineDeleteRequest.md new file mode 100644 index 0000000..ad6985a --- /dev/null +++ b/docs/FaxLineDeleteRequest.md @@ -0,0 +1,11 @@ +# FaxLineDeleteRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```str``` | The Fax Line number. | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FaxLineListResponse.md b/docs/FaxLineListResponse.md new file mode 100644 index 0000000..7510777 --- /dev/null +++ b/docs/FaxLineListResponse.md @@ -0,0 +1,13 @@ +# FaxLineListResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `fax_lines`*_required_ | [```List[FaxLineResponseFaxLine]```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FaxLineRemoveUserRequest.md b/docs/FaxLineRemoveUserRequest.md new file mode 100644 index 0000000..561ddea --- /dev/null +++ b/docs/FaxLineRemoveUserRequest.md @@ -0,0 +1,13 @@ +# FaxLineRemoveUserRequest + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number`*_required_ | ```str``` | The Fax Line number. | | +| `account_id` | ```str``` | Account ID | | +| `email_address` | ```str``` | Email address | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FaxLineResponse.md b/docs/FaxLineResponse.md new file mode 100644 index 0000000..d967591 --- /dev/null +++ b/docs/FaxLineResponse.md @@ -0,0 +1,12 @@ +# FaxLineResponse + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `fax_line`*_required_ | [```FaxLineResponseFaxLine```](FaxLineResponseFaxLine.md) | | | +| `warnings` | [```WarningResponse```](WarningResponse.md) | | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FaxLineResponseFaxLine.md b/docs/FaxLineResponseFaxLine.md new file mode 100644 index 0000000..f3e14c0 --- /dev/null +++ b/docs/FaxLineResponseFaxLine.md @@ -0,0 +1,14 @@ +# FaxLineResponseFaxLine + + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `number` | ```str``` | Number | | +| `created_at` | ```int``` | Created at | | +| `updated_at` | ```int``` | Updated at | | +| `accounts` | [```List[AccountResponse]```](AccountResponse.md) | | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/FileResponse.md b/docs/FileResponse.md index 8c6b211..db71810 100644 --- a/docs/FileResponse.md +++ b/docs/FileResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `file_url` | ```str``` | URL to the file. | | -| `expires_at` | ```int``` | When the link expires. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `file_url`*_required_ | ```str``` | URL to the file. | | +| `expires_at`*_required_ | ```int``` | When the link expires. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/FileResponseDataUri.md b/docs/FileResponseDataUri.md index 4488bf6..aae7f44 100644 --- a/docs/FileResponseDataUri.md +++ b/docs/FileResponseDataUri.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `data_uri` | ```str``` | File as base64 encoded string. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `data_uri`*_required_ | ```str``` | File as base64 encoded string. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ListInfoResponse.md b/docs/ListInfoResponse.md index ee5d510..57a3075 100644 --- a/docs/ListInfoResponse.md +++ b/docs/ListInfoResponse.md @@ -3,15 +3,12 @@ Contains pagination information about the data returned. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `num_pages` | ```int``` | Total number of pages available. | | -| `num_results` | ```int, none_type``` | Total number of objects available. | | +| `num_results` | ```int``` | Total number of objects available. | | | `page` | ```int``` | Number of the page being returned. | | | `page_size` | ```int``` | Objects returned per page. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/OAuthApi.md b/docs/OAuthApi.md index 3c3d191..9bb584d 100644 --- a/docs/OAuthApi.md +++ b/docs/OAuthApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```oauth_token_generate```](OAuthApi.md#oauth_token_generate) | ```POST /oauth/token``` | OAuth Token Generate| |[```oauth_token_refresh```](OAuthApi.md#oauth_token_refresh) | ```POST /oauth/token?refresh``` | OAuth Token Refresh| @@ -43,10 +43,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `o_auth_token_generate_request` | [**OAuthTokenGenerateRequest**](OAuthTokenGenerateRequest.md) | | | @@ -64,7 +63,6 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -105,10 +103,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `o_auth_token_refresh_request` | [**OAuthTokenRefreshRequest**](OAuthTokenRefreshRequest.md) | | | @@ -126,7 +123,6 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/OAuthTokenGenerateRequest.md b/docs/OAuthTokenGenerateRequest.md index 89d7db3..9e53f79 100644 --- a/docs/OAuthTokenGenerateRequest.md +++ b/docs/OAuthTokenGenerateRequest.md @@ -3,16 +3,13 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | The client id of the app requesting authorization. | | | `client_secret`*_required_ | ```str``` | The secret token of your app. | | | `code`*_required_ | ```str``` | The code passed to your callback when the user granted access. | | -| `grant_type`*_required_ | ```str``` | When generating a new token use `authorization_code`. | [default to "authorization_code"] | +| `grant_type`*_required_ | ```str``` | When generating a new token use `authorization_code`. | [default to 'authorization_code'] | | `state`*_required_ | ```str``` | Same as the state you specified earlier. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/OAuthTokenRefreshRequest.md b/docs/OAuthTokenRefreshRequest.md index 99bef2e..9322c48 100644 --- a/docs/OAuthTokenRefreshRequest.md +++ b/docs/OAuthTokenRefreshRequest.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `grant_type`*_required_ | ```str``` | When refreshing an existing token use `refresh_token`. | [default to "refresh_token"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `grant_type`*_required_ | ```str``` | When refreshing an existing token use `refresh_token`. | [default to 'refresh_token'] | | `refresh_token`*_required_ | ```str``` | The token provided when you got the expired access token. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/OAuthTokenResponse.md b/docs/OAuthTokenResponse.md index 4fc8542..a05a77d 100644 --- a/docs/OAuthTokenResponse.md +++ b/docs/OAuthTokenResponse.md @@ -3,16 +3,13 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `access_token` | ```str``` | | | | `token_type` | ```str``` | | | | `refresh_token` | ```str``` | | | | `expires_in` | ```int``` | Number of seconds until the `access_token` expires. Uses epoch time. | | -| `state` | ```str, none_type``` | | | - +| `state` | ```str``` | | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ReportApi.md b/docs/ReportApi.md index 1391cd4..66643f8 100644 --- a/docs/ReportApi.md +++ b/docs/ReportApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```report_create```](ReportApi.md#report_create) | ```POST /report/create``` | Create Report| @@ -48,10 +48,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `report_create_request` | [**ReportCreateRequest**](ReportCreateRequest.md) | | | @@ -69,7 +68,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/ReportCreateRequest.md b/docs/ReportCreateRequest.md index aaa25a3..c14641c 100644 --- a/docs/ReportCreateRequest.md +++ b/docs/ReportCreateRequest.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `end_date`*_required_ | ```str``` | The (inclusive) end date for the report data in `MM/DD/YYYY` format. | | -| `report_type`*_required_ | ```[str]``` | The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | | +| `report_type`*_required_ | ```List[str]``` | The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | | | `start_date`*_required_ | ```str``` | The (inclusive) start date for the report data in `MM/DD/YYYY` format. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ReportCreateResponse.md b/docs/ReportCreateResponse.md index 5272d9a..2ffc8dc 100644 --- a/docs/ReportCreateResponse.md +++ b/docs/ReportCreateResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `report` | [```ReportResponse```](ReportResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `report`*_required_ | [```ReportResponse```](ReportResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ReportResponse.md b/docs/ReportResponse.md index 9c5b1a6..381f19a 100644 --- a/docs/ReportResponse.md +++ b/docs/ReportResponse.md @@ -3,15 +3,12 @@ Contains information about the report request. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `success` | ```str``` | A message indicating the requested operation's success | | | `start_date` | ```str``` | The (inclusive) start date for the report data in MM/DD/YYYY format. | | | `end_date` | ```str``` | The (inclusive) end date for the report data in MM/DD/YYYY format. | | -| `report_type` | ```[str]``` | The type(s) of the report you are requesting. Allowed values are "user_activity" and "document_status". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | | - +| `report_type` | ```List[str]``` | The type(s) of the report you are requesting. Allowed values are "user_activity" and "document_status". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestApi.md b/docs/SignatureRequestApi.md index ada94d4..fc770bc 100644 --- a/docs/SignatureRequestApi.md +++ b/docs/SignatureRequestApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```signature_request_bulk_create_embedded_with_template```](SignatureRequestApi.md#signature_request_bulk_create_embedded_with_template) | ```POST /signature_request/bulk_create_embedded_with_template``` | Embedded Bulk Send with Template| |[```signature_request_bulk_send_with_template```](SignatureRequestApi.md#signature_request_bulk_send_with_template) | ```POST /signature_request/bulk_send_with_template``` | Bulk Send with Template| |[```signature_request_cancel```](SignatureRequestApi.md#signature_request_cancel) | ```POST /signature_request/cancel/{signature_request_id}``` | Cancel Incomplete Signature Request| @@ -106,10 +106,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_bulk_create_embedded_with_template_request` | [**SignatureRequestBulkCreateEmbeddedWithTemplateRequest**](SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md) | | | @@ -127,7 +126,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -221,10 +219,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_bulk_send_with_template_request` | [**SignatureRequestBulkSendWithTemplateRequest**](SignatureRequestBulkSendWithTemplateRequest.md) | | | @@ -242,7 +239,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -287,10 +283,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the incomplete SignatureRequest to cancel. | | @@ -308,7 +303,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -386,10 +380,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_create_embedded_request` | [**SignatureRequestCreateEmbeddedRequest**](SignatureRequestCreateEmbeddedRequest.md) | | | @@ -407,7 +400,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -477,10 +469,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_create_embedded_with_template_request` | [**SignatureRequestCreateEmbeddedWithTemplateRequest**](SignatureRequestCreateEmbeddedWithTemplateRequest.md) | | | @@ -498,7 +489,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -509,7 +499,7 @@ with ApiClient(configuration) as api_client: [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # ```signature_request_files``` -> ```file_type signature_request_files(signature_request_id)``` +> ```io.IOBase signature_request_files(signature_request_id)``` Download Files @@ -546,18 +536,17 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to retrieve. | | -| `file_type` | **str** | Set to `pdf` for a single merged document or `zip` for a collection of individual documents. | [optional][default to "pdf"] | +| `file_type` | **str** | Set to `pdf` for a single merged document or `zip` for a collection of individual documents. | [optional][default to pdf] | ### Return type -**file_type** +**io.IOBase** ### Authorization @@ -568,7 +557,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/pdf, application/zip, application/json - ### HTTP response details | Status code | Description | Response headers | @@ -616,10 +604,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to retrieve. | | @@ -637,7 +624,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -685,10 +671,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to retrieve. | | @@ -707,7 +692,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -755,10 +739,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to retrieve. | | @@ -776,7 +759,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -828,10 +810,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_id` | **str** | Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. | [optional] | @@ -852,7 +833,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -900,10 +880,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to release. | | @@ -921,7 +900,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -973,10 +951,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to send a reminder for. | | @@ -995,7 +972,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -1039,10 +1015,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to remove. | | @@ -1060,7 +1035,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -1149,10 +1123,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_send_request` | [**SignatureRequestSendRequest**](SignatureRequestSendRequest.md) | | | @@ -1170,7 +1143,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -1253,10 +1225,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_send_with_template_request` | [**SignatureRequestSendWithTemplateRequest**](SignatureRequestSendWithTemplateRequest.md) | | | @@ -1274,7 +1245,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -1327,10 +1297,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The id of the SignatureRequest to update. | | @@ -1349,7 +1318,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index 2638f94..1448d24 100644 --- a/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -3,24 +3,21 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template_ids`*_required_ | ```[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_ids`*_required_ | ```List[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `client_id`*_required_ | ```str``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | -| `signer_file` | ```file_type``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | -| `signer_list` | [```[SubBulkSignerList]```](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | | +| `signer_file` | ```io.IOBase``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | +| `signer_list` | [```List[SubBulkSignerList]```](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | -| `ccs` | [```[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `ccs` | [```List[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestBulkSendWithTemplateRequest.md b/docs/SignatureRequestBulkSendWithTemplateRequest.md index c13e5f4..6031e08 100644 --- a/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -3,24 +3,21 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template_ids`*_required_ | ```[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | -| `signer_file` | ```file_type``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | -| `signer_list` | [```[SubBulkSignerList]```](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_ids`*_required_ | ```List[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `signer_file` | ```io.IOBase``` | `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns:

- `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional)

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field" suffix will be treated as a custom field (optional)

You may only specify field values here, any other options should be set in the custom_fields request parameter.

Example CSV:

``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ``` | | +| `signer_list` | [```List[SubBulkSignerList]```](SubBulkSignerList.md) | `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | -| `ccs` | [```[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `ccs` | [```List[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | | `client_id` | ```str``` | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestCreateEmbeddedRequest.md b/docs/SignatureRequestCreateEmbeddedRequest.md index 0b8be5d..98e7083 100644 --- a/docs/SignatureRequestCreateEmbeddedRequest.md +++ b/docs/SignatureRequestCreateEmbeddedRequest.md @@ -3,35 +3,32 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | -| `file_urls` | ```[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | -| `signers` | [```[SubSignatureRequestSigner]```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | -| `grouped_signers` | [```[SubSignatureRequestGroupedSigners]```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```List[SubSignatureRequestSigner]```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `grouped_signers` | [```List[SubSignatureRequestGroupedSigners]```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | | `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan. | [default to False] | -| `attachments` | [```[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | -| `cc_email_addresses` | ```[str]``` | The email addresses that should be CCed. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```List[str]``` | The email addresses that should be CCed. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | | `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | -| `form_field_groups` | [```[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | -| `form_field_rules` | [```[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | -| `form_fields_per_document` | [```[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | | `hide_text_tags` | ```bool``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [default to False] | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | | `use_text_tags` | ```bool``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [default to False] | | `populate_auto_fill_fields` | ```bool``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to False] | -| `expires_at` | ```int, none_type``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | - +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md b/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md index e03242e..f3e8aca 100644 --- a/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -3,26 +3,23 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template_ids`*_required_ | ```[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_ids`*_required_ | ```List[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | | `client_id`*_required_ | ```str``` | Client id of the app you're using to create this embedded signature request. Used for security purposes. | | -| `signers`*_required_ | [```[SubSignatureRequestTemplateSigner]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `signers`*_required_ | [```List[SubSignatureRequestTemplateSigner]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | -| `ccs` | [```[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | -| `file_urls` | ```[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `ccs` | [```List[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | | `populate_auto_fill_fields` | ```bool``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestGetResponse.md b/docs/SignatureRequestGetResponse.md index 09c74de..a0ee83f 100644 --- a/docs/SignatureRequestGetResponse.md +++ b/docs/SignatureRequestGetResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `signature_request` | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `signature_request`*_required_ | [```SignatureRequestResponse```](SignatureRequestResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestListResponse.md b/docs/SignatureRequestListResponse.md index 0e76464..532cf61 100644 --- a/docs/SignatureRequestListResponse.md +++ b/docs/SignatureRequestListResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `signature_requests` | [```[SignatureRequestResponse]```](SignatureRequestResponse.md) | Contains information about signature requests. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `signature_requests`*_required_ | [```List[SignatureRequestResponse]```](SignatureRequestResponse.md) | Contains information about signature requests. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestRemindRequest.md b/docs/SignatureRequestRemindRequest.md index 91a3380..c885130 100644 --- a/docs/SignatureRequestRemindRequest.md +++ b/docs/SignatureRequestRemindRequest.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address`*_required_ | ```str``` | The email address of the signer to send a reminder to. | | | `name` | ```str``` | The name of the signer to send a reminder to. Include if two or more signers share an email address. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponse.md b/docs/SignatureRequestResponse.md index eca1dc2..a8af74c 100644 --- a/docs/SignatureRequestResponse.md +++ b/docs/SignatureRequestResponse.md @@ -3,36 +3,33 @@ Contains information about a signature request. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `test_mode` | ```bool, none_type``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [default to False] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `test_mode` | ```bool``` | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [default to False] | | `signature_request_id` | ```str``` | The id of the SignatureRequest. | | | `requester_email_address` | ```str``` | The email address of the initiator of the SignatureRequest. | | | `title` | ```str``` | The title the specified Account uses for the SignatureRequest. | | | `original_title` | ```str``` | Default Label for account. | | -| `subject` | ```str, none_type``` | The subject in the email that was initially sent to the signers. | | -| `message` | ```str, none_type``` | The custom message in the email that was initially sent to the signers. | | -| `metadata` | [```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}```](.md) | The metadata attached to the signature request. | | +| `subject` | ```str``` | The subject in the email that was initially sent to the signers. | | +| `message` | ```str``` | The custom message in the email that was initially sent to the signers. | | +| `metadata` | ```object``` | The metadata attached to the signature request. | | | `created_at` | ```int``` | Time the signature request was created. | | | `expires_at` | ```int``` | The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | | `is_complete` | ```bool``` | Whether or not the SignatureRequest has been fully executed by all signers. | | | `is_declined` | ```bool``` | Whether or not the SignatureRequest has been declined by a signer. | | | `has_error` | ```bool``` | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | | | `files_url` | ```str``` | The URL where a copy of the request's documents can be downloaded. | | -| `signing_url` | ```str, none_type``` | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | | +| `signing_url` | ```str``` | The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing. | | | `details_url` | ```str``` | The URL where the requester and the signers can view the current status of the SignatureRequest. | | -| `cc_email_addresses` | ```[str]``` | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | | -| `signing_redirect_url` | ```str, none_type``` | The URL you want the signer redirected to after they successfully sign. | | -| `final_copy_uri` | ```str, none_type``` | The path where the completed document can be downloaded | | -| `template_ids` | ```[str], none_type``` | Templates IDs used in this SignatureRequest (if any). | | -| `custom_fields` | [```[SignatureRequestResponseCustomFieldBase], none_type```](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | | -| `attachments` | [```[SignatureRequestResponseAttachment], none_type```](SignatureRequestResponseAttachment.md) | Signer attachments. | | -| `response_data` | [```[SignatureRequestResponseDataBase], none_type```](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | | -| `signatures` | [```[SignatureRequestResponseSignatures]```](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | | -| `bulk_send_job_id` | ```str, none_type``` | The ID of the Bulk Send job which sent the signature request, if applicable. | | - +| `cc_email_addresses` | ```List[str]``` | A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed. | | +| `signing_redirect_url` | ```str``` | The URL you want the signer redirected to after they successfully sign. | | +| `final_copy_uri` | ```str``` | The path where the completed document can be downloaded | | +| `template_ids` | ```List[str]``` | Templates IDs used in this SignatureRequest (if any). | | +| `custom_fields` | [```List[SignatureRequestResponseCustomFieldBase]```](SignatureRequestResponseCustomFieldBase.md) | An array of Custom Field objects containing the name and type of each custom field.

* Text Field uses `SignatureRequestResponseCustomFieldText`
* Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` | | +| `attachments` | [```List[SignatureRequestResponseAttachment]```](SignatureRequestResponseAttachment.md) | Signer attachments. | | +| `response_data` | [```List[SignatureRequestResponseDataBase]```](SignatureRequestResponseDataBase.md) | An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. | | +| `signatures` | [```List[SignatureRequestResponseSignatures]```](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | | +| `bulk_send_job_id` | ```str``` | The ID of the Bulk Send job which sent the signature request, if applicable. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseAttachment.md b/docs/SignatureRequestResponseAttachment.md index 322ac83..a602ec0 100644 --- a/docs/SignatureRequestResponseAttachment.md +++ b/docs/SignatureRequestResponseAttachment.md @@ -3,17 +3,14 @@ Signer attachments. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `id`*_required_ | ```str``` | The unique ID for this attachment. | | | `signer`*_required_ | ```str``` | The Signer this attachment is assigned to. | | | `name`*_required_ | ```str``` | The name of this attachment. | | | `required`*_required_ | ```bool``` | A boolean value denoting if this attachment is required. | | -| `instructions` | ```str, none_type``` | Instructions for Signer. | | -| `uploaded_at` | ```int, none_type``` | Timestamp when attachment was uploaded by Signer. | | - +| `instructions` | ```str``` | Instructions for Signer. | | +| `uploaded_at` | ```int``` | Timestamp when attachment was uploaded by Signer. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseCustomFieldBase.md b/docs/SignatureRequestResponseCustomFieldBase.md index a218c0f..75339e0 100644 --- a/docs/SignatureRequestResponseCustomFieldBase.md +++ b/docs/SignatureRequestResponseCustomFieldBase.md @@ -6,16 +6,13 @@ An array of Custom Field objects containing the name and type of each custom fie * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `type`*_required_ | ```str``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | | | `name`*_required_ | ```str``` | The name of the Custom Field. | | | `required` | ```bool``` | A boolean value denoting if this field is required. | | | `api_id` | ```str``` | The unique ID for this field. | | | `editor` | ```str``` | The name of the Role that is able to edit this field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseCustomFieldCheckbox.md b/docs/SignatureRequestResponseCustomFieldCheckbox.md index 53bae66..d3f9dbc 100644 --- a/docs/SignatureRequestResponseCustomFieldCheckbox.md +++ b/docs/SignatureRequestResponseCustomFieldCheckbox.md @@ -3,13 +3,10 @@ This class extends `SignatureRequestResponseCustomFieldBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "checkbox"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to 'checkbox'] | | `value` | ```bool``` | A true/false for checkbox fields | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseCustomFieldText.md b/docs/SignatureRequestResponseCustomFieldText.md index 520fe03..34222b3 100644 --- a/docs/SignatureRequestResponseCustomFieldText.md +++ b/docs/SignatureRequestResponseCustomFieldText.md @@ -3,13 +3,10 @@ This class extends `SignatureRequestResponseCustomFieldBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "text"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to 'text'] | | `value` | ```str``` | A text string for text fields | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseCustomFieldTypeEnum.md b/docs/SignatureRequestResponseCustomFieldTypeEnum.md index b2705a8..debe8e4 100644 --- a/docs/SignatureRequestResponseCustomFieldTypeEnum.md +++ b/docs/SignatureRequestResponseCustomFieldTypeEnum.md @@ -3,11 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseDataBase.md b/docs/SignatureRequestResponseDataBase.md index 862fcd1..a657e3c 100644 --- a/docs/SignatureRequestResponseDataBase.md +++ b/docs/SignatureRequestResponseDataBase.md @@ -3,16 +3,13 @@ An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `api_id` | ```str``` | The unique ID for this field. | | | `signature_id` | ```str``` | The ID of the signature to which this response is linked. | | | `name` | ```str``` | The name of the form field. | | | `required` | ```bool``` | A boolean value denoting if this field is required. | | | `type` | ```str``` | | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseDataTypeEnum.md b/docs/SignatureRequestResponseDataTypeEnum.md index c0ebf84..102414e 100644 --- a/docs/SignatureRequestResponseDataTypeEnum.md +++ b/docs/SignatureRequestResponseDataTypeEnum.md @@ -3,11 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseDataValueCheckbox.md b/docs/SignatureRequestResponseDataValueCheckbox.md index e9a2231..f52a4be 100644 --- a/docs/SignatureRequestResponseDataValueCheckbox.md +++ b/docs/SignatureRequestResponseDataValueCheckbox.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A yes/no checkbox | [default to "checkbox"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A yes/no checkbox | [default to 'checkbox'] | | `value` | ```bool``` | The value of the form field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseDataValueCheckboxMerge.md b/docs/SignatureRequestResponseDataValueCheckboxMerge.md index b4ba199..c7ad20c 100644 --- a/docs/SignatureRequestResponseDataValueCheckboxMerge.md +++ b/docs/SignatureRequestResponseDataValueCheckboxMerge.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A checkbox field that has default value set by the api | [default to "checkbox-merge"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A checkbox field that has default value set by the api | [default to 'checkbox-merge'] | | `value` | ```str``` | The value of the form field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseDataValueDateSigned.md b/docs/SignatureRequestResponseDataValueDateSigned.md index 7b99e63..d72ecc9 100644 --- a/docs/SignatureRequestResponseDataValueDateSigned.md +++ b/docs/SignatureRequestResponseDataValueDateSigned.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A date | [default to "date_signed"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A date | [default to 'date_signed'] | | `value` | ```str``` | The value of the form field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseDataValueDropdown.md b/docs/SignatureRequestResponseDataValueDropdown.md index 20d95a4..9eef3d0 100644 --- a/docs/SignatureRequestResponseDataValueDropdown.md +++ b/docs/SignatureRequestResponseDataValueDropdown.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | An input field for dropdowns | [default to "dropdown"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | An input field for dropdowns | [default to 'dropdown'] | | `value` | ```str``` | The value of the form field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseDataValueInitials.md b/docs/SignatureRequestResponseDataValueInitials.md index 8d77b11..33a6013 100644 --- a/docs/SignatureRequestResponseDataValueInitials.md +++ b/docs/SignatureRequestResponseDataValueInitials.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | An input field for initials | [default to "initials"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | An input field for initials | [default to 'initials'] | | `value` | ```str``` | The value of the form field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseDataValueRadio.md b/docs/SignatureRequestResponseDataValueRadio.md index 8226972..615a86d 100644 --- a/docs/SignatureRequestResponseDataValueRadio.md +++ b/docs/SignatureRequestResponseDataValueRadio.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | An input field for radios | [default to "radio"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | An input field for radios | [default to 'radio'] | | `value` | ```bool``` | The value of the form field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseDataValueSignature.md b/docs/SignatureRequestResponseDataValueSignature.md index 754bba5..cd15128 100644 --- a/docs/SignatureRequestResponseDataValueSignature.md +++ b/docs/SignatureRequestResponseDataValueSignature.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A signature input field | [default to "signature"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A signature input field | [default to 'signature'] | | `value` | ```str``` | The value of the form field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseDataValueText.md b/docs/SignatureRequestResponseDataValueText.md index 0046c5b..4b38050 100644 --- a/docs/SignatureRequestResponseDataValueText.md +++ b/docs/SignatureRequestResponseDataValueText.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A text input field | [default to "text"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A text input field | [default to 'text'] | | `value` | ```str``` | The value of the form field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseDataValueTextMerge.md b/docs/SignatureRequestResponseDataValueTextMerge.md index c2ace0b..f3e90ba 100644 --- a/docs/SignatureRequestResponseDataValueTextMerge.md +++ b/docs/SignatureRequestResponseDataValueTextMerge.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type` | ```str``` | A text field that has default text set by the api | [default to "text-merge"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type` | ```str``` | A text field that has default text set by the api | [default to 'text-merge'] | | `value` | ```str``` | The value of the form field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestResponseSignatures.md b/docs/SignatureRequestResponseSignatures.md index 913b61e..8125332 100644 --- a/docs/SignatureRequestResponseSignatures.md +++ b/docs/SignatureRequestResponseSignatures.md @@ -3,30 +3,27 @@ An array of signature objects, 1 for each signer. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `signature_id` | ```str``` | Signature identifier. | | -| `signer_group_guid` | ```str, none_type``` | Signer Group GUID | | +| `signer_group_guid` | ```str``` | Signer Group GUID | | | `signer_email_address` | ```str``` | The email address of the signer. | | -| `signer_name` | ```str, none_type``` | The name of the signer. | | -| `signer_role` | ```str, none_type``` | The role of the signer. | | -| `order` | ```int, none_type``` | If signer order is assigned this is the 0-based index for this signer. | | +| `signer_name` | ```str``` | The name of the signer. | | +| `signer_role` | ```str``` | The role of the signer. | | +| `order` | ```int``` | If signer order is assigned this is the 0-based index for this signer. | | | `status_code` | ```str``` | The current status of the signature. eg: awaiting_signature, signed, declined. | | -| `decline_reason` | ```str, none_type``` | The reason provided by the signer for declining the request. | | -| `signed_at` | ```int, none_type``` | Time that the document was signed or null. | | -| `last_viewed_at` | ```int, none_type``` | The time that the document was last viewed by this signer or null. | | -| `last_reminded_at` | ```int, none_type``` | The time the last reminder email was sent to the signer or null. | | +| `decline_reason` | ```str``` | The reason provided by the signer for declining the request. | | +| `signed_at` | ```int``` | Time that the document was signed or null. | | +| `last_viewed_at` | ```int``` | The time that the document was last viewed by this signer or null. | | +| `last_reminded_at` | ```int``` | The time the last reminder email was sent to the signer or null. | | | `has_pin` | ```bool``` | Boolean to indicate whether this signature requires a PIN to access. | | -| `has_sms_auth` | ```bool, none_type``` | Boolean to indicate whether this signature has SMS authentication enabled. | | -| `has_sms_delivery` | ```bool, none_type``` | Boolean to indicate whether this signature has SMS delivery enabled. | | -| `sms_phone_number` | ```str, none_type``` | The SMS phone number used for authentication or signature request delivery. | | -| `reassigned_by` | ```str, none_type``` | Email address of original signer who reassigned to this signer. | | -| `reassignment_reason` | ```str, none_type``` | Reason provided by original signer who reassigned to this signer. | | -| `reassigned_from` | ```str, none_type``` | Previous signature identifier. | | -| `error` | ```str, none_type``` | Error message pertaining to this signer, or null. | | - +| `has_sms_auth` | ```bool``` | Boolean to indicate whether this signature has SMS authentication enabled. | | +| `has_sms_delivery` | ```bool``` | Boolean to indicate whether this signature has SMS delivery enabled. | | +| `sms_phone_number` | ```str``` | The SMS phone number used for authentication or signature request delivery. | | +| `reassigned_by` | ```str``` | Email address of original signer who reassigned to this signer. | | +| `reassignment_reason` | ```str``` | Reason provided by original signer who reassigned to this signer. | | +| `reassigned_from` | ```str``` | Previous signature identifier. | | +| `error` | ```str``` | Error message pertaining to this signer, or null. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestSendRequest.md b/docs/SignatureRequestSendRequest.md index b721462..beb3ae0 100644 --- a/docs/SignatureRequestSendRequest.md +++ b/docs/SignatureRequestSendRequest.md @@ -3,37 +3,34 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | -| `file_urls` | ```[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | -| `signers` | [```[SubSignatureRequestSigner]```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | -| `grouped_signers` | [```[SubSignatureRequestGroupedSigners]```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `signers` | [```List[SubSignatureRequestSigner]```](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | +| `grouped_signers` | [```List[SubSignatureRequestGroupedSigners]```](SubSignatureRequestGroupedSigners.md) | Add Grouped Signers to your Signature Request.

This endpoint requires either **signers** or **grouped_signers**, but not both. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | | `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to False] | -| `attachments` | [```[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | -| `cc_email_addresses` | ```[str]``` | The email addresses that should be CCed. | | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```List[str]``` | The email addresses that should be CCed. | | | `client_id` | ```str``` | The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | | `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | -| `form_field_groups` | [```[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | -| `form_field_rules` | [```[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | -| `form_fields_per_document` | [```[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | | `hide_text_tags` | ```bool``` | Enables automatic Text Tag removal when set to true.

**NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information. | [default to False] | | `is_qualified_signature` | ```bool``` | Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br>
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to False] | | `is_eid` | ```bool``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to False] | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | | `use_text_tags` | ```bool``` | Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`. | [default to False] | -| `expires_at` | ```int, none_type``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | - +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestSendWithTemplateRequest.md b/docs/SignatureRequestSendWithTemplateRequest.md index ccba3f6..d065890 100644 --- a/docs/SignatureRequestSendWithTemplateRequest.md +++ b/docs/SignatureRequestSendWithTemplateRequest.md @@ -3,28 +3,25 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template_ids`*_required_ | ```[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | -| `signers`*_required_ | [```[SubSignatureRequestTemplateSigner]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_ids`*_required_ | ```List[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | | +| `signers`*_required_ | [```List[SubSignatureRequestTemplateSigner]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | -| `ccs` | [```[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `ccs` | [```List[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | | `client_id` | ```str``` | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | -| `file_urls` | ```[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `is_qualified_signature` | ```bool``` | Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.<br>
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to False] | | `is_eid` | ```bool``` | Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br>
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer. | [default to False] | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SignatureRequestUpdateRequest.md b/docs/SignatureRequestUpdateRequest.md index fcca65a..10ada0f 100644 --- a/docs/SignatureRequestUpdateRequest.md +++ b/docs/SignatureRequestUpdateRequest.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `signature_id`*_required_ | ```str``` | The signature ID for the recipient. | | | `email_address` | ```str``` | The new email address for the recipient.

This will generate a new `signature_id` value.

**NOTE:** Optional if `name` is provided. | | | `name` | ```str``` | The new name for the recipient.

**NOTE:** Optional if `email_address` is provided. | | -| `expires_at` | ```int, none_type``` | The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | - +| `expires_at` | ```int``` | The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubAttachment.md b/docs/SubAttachment.md index ebf82d5..2730666 100644 --- a/docs/SubAttachment.md +++ b/docs/SubAttachment.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name`*_required_ | ```str``` | The name of attachment. | | | `signer_index`*_required_ | ```int``` | The signer's index in the `signers` parameter (0-based indexing).

**NOTE:** Only one signer can be assigned per attachment. | | | `instructions` | ```str``` | The instructions for uploading the attachment. | | | `required` | ```bool``` | Determines if the attachment must be uploaded. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubBulkSignerList.md b/docs/SubBulkSignerList.md index b4e937b..4079ca1 100644 --- a/docs/SubBulkSignerList.md +++ b/docs/SubBulkSignerList.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `custom_fields` | [```[SubBulkSignerListCustomField]```](SubBulkSignerListCustomField.md) | An array of custom field values. | | -| `signers` | [```[SubSignatureRequestTemplateSigner]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document.

Currently only templates with a single role are supported. All signers must have the same `role` value. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `custom_fields` | [```List[SubBulkSignerListCustomField]```](SubBulkSignerListCustomField.md) | An array of custom field values. | | +| `signers` | [```List[SubSignatureRequestTemplateSigner]```](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document.

Currently only templates with a single role are supported. All signers must have the same `role` value. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubBulkSignerListCustomField.md b/docs/SubBulkSignerListCustomField.md index 079637d..6ff5de0 100644 --- a/docs/SubBulkSignerListCustomField.md +++ b/docs/SubBulkSignerListCustomField.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name`*_required_ | ```str``` | The name of the custom field. Must be the field's `name` or `api_id`. | | | `value`*_required_ | ```str``` | The value of the custom field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubCC.md b/docs/SubCC.md index aad785e..0a9267d 100644 --- a/docs/SubCC.md +++ b/docs/SubCC.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `role`*_required_ | ```str``` | Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. | | | `email_address`*_required_ | ```str``` | The email address of the CC recipient. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubCustomField.md b/docs/SubCustomField.md index 7d70ab0..7aff768 100644 --- a/docs/SubCustomField.md +++ b/docs/SubCustomField.md @@ -7,15 +7,12 @@ Pre-filled data can be used with "send-once" signature requests by add For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name`*_required_ | ```str``` | The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. | | | `editor` | ```str``` | Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`.

**NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable. | | | `required` | ```bool``` | Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`. | [default to False] | | `value` | ```str``` | The string that resolves (aka "pre-fills") to the merge field on the final document(s) used for signing. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubEditorOptions.md b/docs/SubEditorOptions.md index 4cf8415..4ee12c2 100644 --- a/docs/SubEditorOptions.md +++ b/docs/SubEditorOptions.md @@ -3,13 +3,10 @@ This allows the requester to specify editor options when a preparing a document ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `allow_edit_signers` | ```bool``` | Allows requesters to edit the list of signers | [default to False] | | `allow_edit_documents` | ```bool``` | Allows requesters to edit documents, including delete and add | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFieldOptions.md b/docs/SubFieldOptions.md index ef256c0..3d40efd 100644 --- a/docs/SubFieldOptions.md +++ b/docs/SubFieldOptions.md @@ -3,12 +3,9 @@ This allows the requester to specify field options for a signature request. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `date_format`*_required_ | ```str``` | Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats))

**NOTE:** Only available for Premium and higher. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldGroup.md b/docs/SubFormFieldGroup.md index ace9c09..af8de77 100644 --- a/docs/SubFormFieldGroup.md +++ b/docs/SubFormFieldGroup.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `group_id`*_required_ | ```str``` | ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. | | | `group_label`*_required_ | ```str``` | Name of the group | | | `requirement`*_required_ | ```str``` | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldRule.md b/docs/SubFormFieldRule.md index 38561d7..1e4658e 100644 --- a/docs/SubFormFieldRule.md +++ b/docs/SubFormFieldRule.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `id`*_required_ | ```str``` | Must be unique across all defined rules. | | -| `trigger_operator`*_required_ | ```str``` | Currently only `AND` is supported. Support for `OR` is being worked on. | [default to "AND"] | -| `triggers`*_required_ | [```[SubFormFieldRuleTrigger]```](SubFormFieldRuleTrigger.md) | An array of trigger definitions, the "if this" part of "**if this**, then that". Currently only a single trigger per rule is allowed. | | -| `actions`*_required_ | [```[SubFormFieldRuleAction]```](SubFormFieldRuleAction.md) | An array of action definitions, the "then that" part of "if this, **then that**". Any number of actions may be attached to a single rule. | | - +| `trigger_operator`*_required_ | ```str``` | Currently only `AND` is supported. Support for `OR` is being worked on. | [default to 'AND'] | +| `triggers`*_required_ | [```List[SubFormFieldRuleTrigger]```](SubFormFieldRuleTrigger.md) | An array of trigger definitions, the "if this" part of "**if this**, then that". Currently only a single trigger per rule is allowed. | | +| `actions`*_required_ | [```List[SubFormFieldRuleAction]```](SubFormFieldRuleAction.md) | An array of action definitions, the "then that" part of "if this, **then that**". Any number of actions may be attached to a single rule. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldRuleAction.md b/docs/SubFormFieldRuleAction.md index b0e02ba..6d38e07 100644 --- a/docs/SubFormFieldRuleAction.md +++ b/docs/SubFormFieldRuleAction.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `hidden`*_required_ | ```bool``` | `true` to hide the target field when rule is satisfied, otherwise `false`. | | | `type`*_required_ | ```str``` | | | | `field_id` | ```str``` | **field_id** or **group_id** is required, but not both.

Must reference the `api_id` of an existing field defined within `form_fields_per_document`.

Cannot use with `group_id`. Trigger and action fields must belong to the same signer. | | | `group_id` | ```str``` | **group_id** or **field_id** is required, but not both.

Must reference the ID of an existing group defined within `form_field_groups`.

Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldRuleTrigger.md b/docs/SubFormFieldRuleTrigger.md index 3b411c6..0ff0bbf 100644 --- a/docs/SubFormFieldRuleTrigger.md +++ b/docs/SubFormFieldRuleTrigger.md @@ -3,15 +3,12 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `id`*_required_ | ```str``` | Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. | | | `operator`*_required_ | ```str``` | Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value | | | `value` | ```str``` | **value** or **values** is required, but not both.

The value to match against **operator**.

- When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match`

Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1` | | -| `values` | ```[str]``` | **values** or **value** is required, but not both.

The values to match against **operator** when it is one of the following:

- `any` - `none` | | - +| `values` | ```List[str]``` | **values** or **value** is required, but not both.

The values to match against **operator** when it is one of the following:

- `any` - `none` | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentBase.md b/docs/SubFormFieldsPerDocumentBase.md index 7e72611..12da98a 100644 --- a/docs/SubFormFieldsPerDocumentBase.md +++ b/docs/SubFormFieldsPerDocumentBase.md @@ -16,9 +16,8 @@ The fields that should appear on the document, expressed as an array of objects. * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `document_index`*_required_ | ```int``` | Represents the integer index of the `file` or `file_url` document the field should be attached to. | | | `api_id`*_required_ | ```str``` | An identifier for the field that is unique across all documents in the request. | | | `height`*_required_ | ```int``` | Size of the field in pixels. | | @@ -29,9 +28,7 @@ The fields that should appear on the document, expressed as an array of objects. | `x`*_required_ | ```int``` | Location coordinates of the field in pixels. | | | `y`*_required_ | ```int``` | Location coordinates of the field in pixels. | | | `name` | ```str``` | Display name for the field. | | -| `page` | ```int, none_type``` | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | | - +| `page` | ```int``` | Page in the document where the field should be placed (requires documents be PDF files).

- When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentCheckbox.md b/docs/SubFormFieldsPerDocumentCheckbox.md index 348ea62..ac3ac20 100644 --- a/docs/SubFormFieldsPerDocumentCheckbox.md +++ b/docs/SubFormFieldsPerDocumentCheckbox.md @@ -3,14 +3,11 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. | [default to "checkbox"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. | [default to 'checkbox'] | | `is_checked`*_required_ | ```bool``` | `true` for checking the checkbox field by default, otherwise `false`. | | | `group` | ```str``` | String referencing group defined in `form_field_groups` parameter. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentCheckboxMerge.md b/docs/SubFormFieldsPerDocumentCheckboxMerge.md index 590d4c9..70ddec8 100644 --- a/docs/SubFormFieldsPerDocumentCheckboxMerge.md +++ b/docs/SubFormFieldsPerDocumentCheckboxMerge.md @@ -3,12 +3,9 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. | [default to "checkbox-merge"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. | [default to 'checkbox-merge'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentDateSigned.md b/docs/SubFormFieldsPerDocumentDateSigned.md index 26cd41b..894e416 100644 --- a/docs/SubFormFieldsPerDocumentDateSigned.md +++ b/docs/SubFormFieldsPerDocumentDateSigned.md @@ -3,14 +3,11 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A date. Use the `SubFormFieldsPerDocumentDateSigned` class. | [default to "date_signed"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A date. Use the `SubFormFieldsPerDocumentDateSigned` class. | [default to 'date_signed'] | | `font_family` | ```str``` | Font family for the field. | | | `font_size` | ```int``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [default to 12] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentDropdown.md b/docs/SubFormFieldsPerDocumentDropdown.md index 8a984e7..b2ad0d6 100644 --- a/docs/SubFormFieldsPerDocumentDropdown.md +++ b/docs/SubFormFieldsPerDocumentDropdown.md @@ -3,16 +3,13 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. | [default to "dropdown"] | -| `options`*_required_ | ```[str]``` | Array of string values representing dropdown values. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. | [default to 'dropdown'] | +| `options`*_required_ | ```List[str]``` | Array of string values representing dropdown values. | | | `content` | ```str``` | Selected value in `options` array. Value must exist in array. | | | `font_family` | ```str``` | Font family for the field. | | | `font_size` | ```int``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [default to 12] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentFontEnum.md b/docs/SubFormFieldsPerDocumentFontEnum.md index 403f882..30e4389 100644 --- a/docs/SubFormFieldsPerDocumentFontEnum.md +++ b/docs/SubFormFieldsPerDocumentFontEnum.md @@ -3,11 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentHyperlink.md b/docs/SubFormFieldsPerDocumentHyperlink.md index 29fa2bd..821d474 100644 --- a/docs/SubFormFieldsPerDocumentHyperlink.md +++ b/docs/SubFormFieldsPerDocumentHyperlink.md @@ -3,16 +3,13 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. | [default to "hyperlink"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. | [default to 'hyperlink'] | | `content`*_required_ | ```str``` | Link Text. | | | `content_url`*_required_ | ```str``` | Link URL. | | | `font_family` | ```str``` | Font family for the field. | | | `font_size` | ```int``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [default to 12] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentInitials.md b/docs/SubFormFieldsPerDocumentInitials.md index b6c01c1..978db25 100644 --- a/docs/SubFormFieldsPerDocumentInitials.md +++ b/docs/SubFormFieldsPerDocumentInitials.md @@ -3,12 +3,9 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. | [default to "initials"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. | [default to 'initials'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentRadio.md b/docs/SubFormFieldsPerDocumentRadio.md index 0a89c86..96789cb 100644 --- a/docs/SubFormFieldsPerDocumentRadio.md +++ b/docs/SubFormFieldsPerDocumentRadio.md @@ -3,14 +3,11 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. | [default to "radio"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. | [default to 'radio'] | | `group`*_required_ | ```str``` | String referencing group defined in `form_field_groups` parameter. | | | `is_checked`*_required_ | ```bool``` | `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentSignature.md b/docs/SubFormFieldsPerDocumentSignature.md index c1d4427..b1fb996 100644 --- a/docs/SubFormFieldsPerDocumentSignature.md +++ b/docs/SubFormFieldsPerDocumentSignature.md @@ -3,12 +3,9 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. | [default to "signature"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. | [default to 'signature'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentText.md b/docs/SubFormFieldsPerDocumentText.md index e0ddbf4..0456d7b 100644 --- a/docs/SubFormFieldsPerDocumentText.md +++ b/docs/SubFormFieldsPerDocumentText.md @@ -3,10 +3,9 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A text input field. Use the `SubFormFieldsPerDocumentText` class. | [default to "text"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A text input field. Use the `SubFormFieldsPerDocumentText` class. | [default to 'text'] | | `placeholder` | ```str``` | Placeholder value for text field. | | | `auto_fill_type` | ```str``` | Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values. | | | `link_id` | ```str``` | Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. | | @@ -18,7 +17,5 @@ This class extends `SubFormFieldsPerDocumentBase`. | `font_family` | ```str``` | Font family for the field. | | | `font_size` | ```int``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [default to 12] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentTextMerge.md b/docs/SubFormFieldsPerDocumentTextMerge.md index 8bee2e6..5670ce9 100644 --- a/docs/SubFormFieldsPerDocumentTextMerge.md +++ b/docs/SubFormFieldsPerDocumentTextMerge.md @@ -3,14 +3,11 @@ This class extends `SubFormFieldsPerDocumentBase`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. | [default to "text-merge"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. | [default to 'text-merge'] | | `font_family` | ```str``` | Font family for the field. | | | `font_size` | ```int``` | The initial px font size for the field contents. Can be any integer value between `7` and `49`.

**NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field. | [default to 12] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubFormFieldsPerDocumentTypeEnum.md b/docs/SubFormFieldsPerDocumentTypeEnum.md index 598090c..e2f8ca5 100644 --- a/docs/SubFormFieldsPerDocumentTypeEnum.md +++ b/docs/SubFormFieldsPerDocumentTypeEnum.md @@ -3,11 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubMergeField.md b/docs/SubMergeField.md index 41fdec5..9066c07 100644 --- a/docs/SubMergeField.md +++ b/docs/SubMergeField.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name`*_required_ | ```str``` | The name of the merge field. Must be unique. | | | `type`*_required_ | ```str``` | The type of merge field. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubOAuth.md b/docs/SubOAuth.md index 5c99059..524b04f 100644 --- a/docs/SubOAuth.md +++ b/docs/SubOAuth.md @@ -3,13 +3,10 @@ OAuth related parameters. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `callback_url` | ```str``` | The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) | | -| `scopes` | ```[str]``` | A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). | | - +| `scopes` | ```List[str]``` | A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubOptions.md b/docs/SubOptions.md index be7b7d5..62ff1a9 100644 --- a/docs/SubOptions.md +++ b/docs/SubOptions.md @@ -3,12 +3,9 @@ Additional options supported by API App. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `can_insert_everywhere` | ```bool``` | Determines if signers can use "Insert Everywhere" when signing a document. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubSignatureRequestGroupedSigners.md b/docs/SubSignatureRequestGroupedSigners.md index 83f8e90..179f27b 100644 --- a/docs/SubSignatureRequestGroupedSigners.md +++ b/docs/SubSignatureRequestGroupedSigners.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `group`*_required_ | ```str``` | The name of the group. | | -| `signers`*_required_ | [```[SubSignatureRequestSigner]```](SubSignatureRequestSigner.md) | Signers belonging to this Group.

**NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. | | -| `order` | ```int, none_type``` | The order the group is required to sign in. Use this instead of Signer-level `order`. | | - +| `signers`*_required_ | [```List[SubSignatureRequestSigner]```](SubSignatureRequestSigner.md) | Signers belonging to this Group.

**NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. | | +| `order` | ```int``` | The order the group is required to sign in. Use this instead of Signer-level `order`. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubSignatureRequestSigner.md b/docs/SubSignatureRequestSigner.md index 731887c..0a122bc 100644 --- a/docs/SubSignatureRequestSigner.md +++ b/docs/SubSignatureRequestSigner.md @@ -3,17 +3,14 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name`*_required_ | ```str``` | The name of the signer. | | | `email_address`*_required_ | ```str``` | The email address of the signer. | | -| `order` | ```int, none_type``` | The order the signer is required to sign in. | | +| `order` | ```int``` | The order the signer is required to sign in. | | | `pin` | ```str``` | The 4- to 12-character access code that will secure this signer's signature page. | | | `sms_phone_number` | ```str``` | An E.164 formatted phone number.

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. | | | `sms_phone_number_type` | ```str``` | Specifies the feature used with the `sms_phone_number`. Default `authentication`.

If `authentication`, signer is sent a verification code via SMS that is required to access the document.

If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubSignatureRequestTemplateSigner.md b/docs/SubSignatureRequestTemplateSigner.md index 94596aa..d1ca992 100644 --- a/docs/SubSignatureRequestTemplateSigner.md +++ b/docs/SubSignatureRequestTemplateSigner.md @@ -3,9 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `role`*_required_ | ```str``` | Must match an existing role in chosen Template(s). It's case-sensitive. | | | `name`*_required_ | ```str``` | The name of the signer. | | | `email_address`*_required_ | ```str``` | The email address of the signer. | | @@ -13,7 +12,5 @@ | `sms_phone_number` | ```str``` | An E.164 formatted phone number.

By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on).

**NOTE:** Not available in test mode and requires a Standard plan or higher. | | | `sms_phone_number_type` | ```str``` | Specifies the feature used with the `sms_phone_number`. Default `authentication`.

If `authentication`, signer is sent a verification code via SMS that is required to access the document.

If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email). | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubSigningOptions.md b/docs/SubSigningOptions.md index 0c13e4c..a060bd1 100644 --- a/docs/SubSigningOptions.md +++ b/docs/SubSigningOptions.md @@ -5,16 +5,13 @@ This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `default_type`*_required_ | ```str``` | The default type shown (limited to the listed types) | | | `draw` | ```bool``` | Allows drawing the signature | [default to False] | | `phone` | ```bool``` | Allows using a smartphone to email the signature | [default to False] | | `type` | ```bool``` | Allows typing the signature | [default to False] | | `upload` | ```bool``` | Allows uploading the signature | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubTeamResponse.md b/docs/SubTeamResponse.md index a41fc55..5c655b1 100644 --- a/docs/SubTeamResponse.md +++ b/docs/SubTeamResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `team_id` | ```str``` | The id of a team | | | `name` | ```str``` | The name of a team | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubTemplateRole.md b/docs/SubTemplateRole.md index 196dd89..09d0d74 100644 --- a/docs/SubTemplateRole.md +++ b/docs/SubTemplateRole.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The role name of the signer that will be displayed when the template is used to create a signature request. | | -| `order` | ```int, none_type``` | The order in which this signer role is required to sign. | | - +| `order` | ```int``` | The order in which this signer role is required to sign. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubUnclaimedDraftSigner.md b/docs/SubUnclaimedDraftSigner.md index 731cba2..a542cec 100644 --- a/docs/SubUnclaimedDraftSigner.md +++ b/docs/SubUnclaimedDraftSigner.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address`*_required_ | ```str``` | The email address of the signer. | | | `name`*_required_ | ```str``` | The name of the signer. | | -| `order` | ```int, none_type``` | The order the signer is required to sign in. | | - +| `order` | ```int``` | The order the signer is required to sign in. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubUnclaimedDraftTemplateSigner.md b/docs/SubUnclaimedDraftTemplateSigner.md index e8df5f3..481850b 100644 --- a/docs/SubUnclaimedDraftTemplateSigner.md +++ b/docs/SubUnclaimedDraftTemplateSigner.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `role`*_required_ | ```str``` | Must match an existing role in chosen Template(s). | | | `name`*_required_ | ```str``` | The name of the signer filling the role of `role`. | | | `email_address`*_required_ | ```str``` | The email address of the signer filling the role of `role`. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SubWhiteLabelingOptions.md b/docs/SubWhiteLabelingOptions.md index 1b63f2d..ac30153 100644 --- a/docs/SubWhiteLabelingOptions.md +++ b/docs/SubWhiteLabelingOptions.md @@ -5,26 +5,23 @@ An array of elements and values serialized to a string, to be used to customize Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `header_background_color` | ```str``` | | [default to "#1A1A1A"] | -| `legal_version` | ```str``` | | [default to "terms1"] | -| `link_color` | ```str``` | | [default to "#00B3E6"] | -| `page_background_color` | ```str``` | | [default to "#F7F8F9"] | -| `primary_button_color` | ```str``` | | [default to "#00B3E6"] | -| `primary_button_color_hover` | ```str``` | | [default to "#00B3E6"] | -| `primary_button_text_color` | ```str``` | | [default to "#FFFFFF"] | -| `primary_button_text_color_hover` | ```str``` | | [default to "#FFFFFF"] | -| `secondary_button_color` | ```str``` | | [default to "#FFFFFF"] | -| `secondary_button_color_hover` | ```str``` | | [default to "#FFFFFF"] | -| `secondary_button_text_color` | ```str``` | | [default to "#00B3E6"] | -| `secondary_button_text_color_hover` | ```str``` | | [default to "#00B3E6"] | -| `text_color1` | ```str``` | | [default to "#808080"] | -| `text_color2` | ```str``` | | [default to "#FFFFFF"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `header_background_color` | ```str``` | | [default to '#1A1A1A'] | +| `legal_version` | ```str``` | | [default to 'terms1'] | +| `link_color` | ```str``` | | [default to '#00B3E6'] | +| `page_background_color` | ```str``` | | [default to '#F7F8F9'] | +| `primary_button_color` | ```str``` | | [default to '#00B3E6'] | +| `primary_button_color_hover` | ```str``` | | [default to '#00B3E6'] | +| `primary_button_text_color` | ```str``` | | [default to '#FFFFFF'] | +| `primary_button_text_color_hover` | ```str``` | | [default to '#FFFFFF'] | +| `secondary_button_color` | ```str``` | | [default to '#FFFFFF'] | +| `secondary_button_color_hover` | ```str``` | | [default to '#FFFFFF'] | +| `secondary_button_text_color` | ```str``` | | [default to '#00B3E6'] | +| `secondary_button_text_color_hover` | ```str``` | | [default to '#00B3E6'] | +| `text_color1` | ```str``` | | [default to '#808080'] | +| `text_color2` | ```str``` | | [default to '#FFFFFF'] | | `reset_to_default` | ```bool``` | Resets white labeling options to defaults. Only useful when updating an API App. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamAddMemberRequest.md b/docs/TeamAddMemberRequest.md index 40d3ee7..8b3120f 100644 --- a/docs/TeamAddMemberRequest.md +++ b/docs/TeamAddMemberRequest.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | `account_id` or `email_address` is required. If both are provided, the account id prevails.

Account id of the user to invite to your Team. | | | `email_address` | ```str``` | `account_id` or `email_address` is required, If both are provided, the account id prevails.

Email address of the user to invite to your Team. | | | `role` | ```str``` | A role member will take in a new Team.

**NOTE:** This parameter is used only if `team_id` is provided. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamApi.md b/docs/TeamApi.md index 8f4318e..d2cda32 100644 --- a/docs/TeamApi.md +++ b/docs/TeamApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```team_add_member```](TeamApi.md#team_add_member) | ```PUT /team/add_member``` | Add User to Team| |[```team_create```](TeamApi.md#team_create) | ```POST /team/create``` | Create Team| |[```team_delete```](TeamApi.md#team_delete) | ```DELETE /team/destroy``` | Delete Team| @@ -56,10 +56,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_add_member_request` | [**TeamAddMemberRequest**](TeamAddMemberRequest.md) | | | @@ -78,7 +77,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -128,10 +126,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_create_request` | [**TeamCreateRequest**](TeamCreateRequest.md) | | | @@ -149,7 +146,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -192,10 +188,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -211,7 +206,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -257,10 +251,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -276,7 +269,6 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -322,10 +314,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_id` | **str** | The id of the team. | [optional] | @@ -343,7 +334,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -391,10 +381,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `email_address` | **str** | The email address for which to display the team invites. | [optional] | @@ -412,7 +401,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -460,10 +448,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_id` | **str** | The id of the team that a member list is being requested from. | | @@ -483,7 +470,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -534,10 +520,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_remove_member_request` | [**TeamRemoveMemberRequest**](TeamRemoveMemberRequest.md) | | | @@ -555,7 +540,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -603,10 +587,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_id` | **str** | The id of the parent Team. | | @@ -626,7 +609,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -676,10 +658,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `team_update_request` | [**TeamUpdateRequest**](TeamUpdateRequest.md) | | | @@ -697,7 +678,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/TeamCreateRequest.md b/docs/TeamCreateRequest.md index 132a1a3..41d0b75 100644 --- a/docs/TeamCreateRequest.md +++ b/docs/TeamCreateRequest.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `name` | ```str``` | The name of your Team. | [default to "Untitled Team"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `name` | ```str``` | The name of your Team. | [default to 'Untitled Team'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamGetInfoResponse.md b/docs/TeamGetInfoResponse.md index aecd951..b7c0dad 100644 --- a/docs/TeamGetInfoResponse.md +++ b/docs/TeamGetInfoResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `team` | [```TeamInfoResponse```](TeamInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `team`*_required_ | [```TeamInfoResponse```](TeamInfoResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamGetResponse.md b/docs/TeamGetResponse.md index cc950e7..9443320 100644 --- a/docs/TeamGetResponse.md +++ b/docs/TeamGetResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `team` | [```TeamResponse```](TeamResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `team`*_required_ | [```TeamResponse```](TeamResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamInfoResponse.md b/docs/TeamInfoResponse.md index 3d19173..832a130 100644 --- a/docs/TeamInfoResponse.md +++ b/docs/TeamInfoResponse.md @@ -3,16 +3,13 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `team_id` | ```str``` | The id of a team | | | `team_parent` | [```TeamParentResponse```](TeamParentResponse.md) | | | | `name` | ```str``` | The name of a team | | | `num_members` | ```int``` | Number of members within a team | | | `num_sub_teams` | ```int``` | Number of sub teams within a team | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamInviteResponse.md b/docs/TeamInviteResponse.md index 8c7cf80..8e6e284 100644 --- a/docs/TeamInviteResponse.md +++ b/docs/TeamInviteResponse.md @@ -3,9 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `email_address` | ```str``` | Email address of the user invited to this team. | | | `team_id` | ```str``` | Id of the team. | | | `role` | ```str``` | Role of the user invited to this team. | | @@ -13,7 +12,5 @@ | `redeemed_at` | ```int``` | Timestamp when the invitation was redeemed. | | | `expires_at` | ```int``` | Timestamp when the invitation is expiring. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamInvitesResponse.md b/docs/TeamInvitesResponse.md index 58eda28..2b8097d 100644 --- a/docs/TeamInvitesResponse.md +++ b/docs/TeamInvitesResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `team_invites` | [```[TeamInviteResponse]```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `team_invites`*_required_ | [```List[TeamInviteResponse]```](TeamInviteResponse.md) | Contains a list of team invites and their roles. | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamMemberResponse.md b/docs/TeamMemberResponse.md index d6ed7c8..0bb958d 100644 --- a/docs/TeamMemberResponse.md +++ b/docs/TeamMemberResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | Account id of the team member. | | | `email_address` | ```str``` | Email address of the team member. | | | `role` | ```str``` | The specific role a member has on the team. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamMembersResponse.md b/docs/TeamMembersResponse.md index 2fadc89..1d04f67 100644 --- a/docs/TeamMembersResponse.md +++ b/docs/TeamMembersResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `team_members` | [```[TeamMemberResponse]```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `team_members`*_required_ | [```List[TeamMemberResponse]```](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamParentResponse.md b/docs/TeamParentResponse.md index c1347cd..ef6e9fb 100644 --- a/docs/TeamParentResponse.md +++ b/docs/TeamParentResponse.md @@ -3,13 +3,10 @@ Information about the parent team if a team has one, set to `null` otherwise. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `team_id` | ```str``` | The id of a team | | | `name` | ```str``` | The name of a team | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamRemoveMemberRequest.md b/docs/TeamRemoveMemberRequest.md index 7cc6c70..1f9445f 100644 --- a/docs/TeamRemoveMemberRequest.md +++ b/docs/TeamRemoveMemberRequest.md @@ -3,16 +3,13 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Account id to remove from your Team. | | | `email_address` | ```str``` | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Email address of the Account to remove from your Team. | | | `new_owner_email_address` | ```str``` | The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account.

**NOTE:** Only available for Enterprise plans. | | | `new_team_id` | ```str``` | Id of the new Team. | | | `new_role` | ```str``` | A new role member will take in a new Team.

**NOTE:** This parameter is used only if `new_team_id` is provided. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamResponse.md b/docs/TeamResponse.md index dc1fadc..150fd64 100644 --- a/docs/TeamResponse.md +++ b/docs/TeamResponse.md @@ -3,15 +3,12 @@ Contains information about your team and its members ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The name of your Team | | -| `accounts` | [```[AccountResponse]```](AccountResponse.md) | | | -| `invited_accounts` | [```[AccountResponse]```](AccountResponse.md) | A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. | | -| `invited_emails` | ```[str]``` | A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. | | - +| `accounts` | [```List[AccountResponse]```](AccountResponse.md) | | | +| `invited_accounts` | [```List[AccountResponse]```](AccountResponse.md) | A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`. | | +| `invited_emails` | ```List[str]``` | A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamSubTeamsResponse.md b/docs/TeamSubTeamsResponse.md index afd481b..549f850 100644 --- a/docs/TeamSubTeamsResponse.md +++ b/docs/TeamSubTeamsResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `sub_teams` | [```[SubTeamResponse]```](SubTeamResponse.md) | Contains a list with sub teams. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `sub_teams`*_required_ | [```List[SubTeamResponse]```](SubTeamResponse.md) | Contains a list with sub teams. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TeamUpdateRequest.md b/docs/TeamUpdateRequest.md index 56cf999..086b33d 100644 --- a/docs/TeamUpdateRequest.md +++ b/docs/TeamUpdateRequest.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The name of your Team. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateAddUserRequest.md b/docs/TemplateAddUserRequest.md index d3adc20..a8ee5eb 100644 --- a/docs/TemplateAddUserRequest.md +++ b/docs/TemplateAddUserRequest.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | The id of the Account to give access to the Template.
**NOTE:** The account id prevails if email address is also provided. | | | `email_address` | ```str``` | The email address of the Account to give access to the Template.
**NOTE:** The account id prevails if it is also provided. | | | `skip_notification` | ```bool``` | If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateApi.md b/docs/TemplateApi.md index 6651a7c..787b5ef 100644 --- a/docs/TemplateApi.md +++ b/docs/TemplateApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```template_add_user```](TemplateApi.md#template_add_user) | ```POST /template/add_user/{template_id}``` | Add User to Template| |[```template_create```](TemplateApi.md#template_create) | ```POST /template/create``` | Create Template| |[```template_create_embedded_draft```](TemplateApi.md#template_create_embedded_draft) | ```POST /template/create_embedded_draft``` | Create Embedded Template Draft| @@ -59,10 +59,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the Template to give the Account access to. | | @@ -81,7 +80,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -164,10 +162,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_create_request` | [**TemplateCreateRequest**](TemplateCreateRequest.md) | | | @@ -185,7 +182,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -268,10 +264,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_create_embedded_draft_request` | [**TemplateCreateEmbeddedDraftRequest**](TemplateCreateEmbeddedDraftRequest.md) | | | @@ -289,7 +284,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -334,10 +328,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the Template to delete. | | @@ -355,7 +348,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -366,7 +358,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # ```template_files``` -> ```file_type template_files(template_id)``` +> ```io.IOBase template_files(template_id)``` Get Template Files @@ -403,10 +395,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the template files to retrieve. | | @@ -414,7 +405,7 @@ with ApiClient(configuration) as api_client: ### Return type -**file_type** +**io.IOBase** ### Authorization @@ -425,7 +416,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/pdf, application/zip, application/json - ### HTTP response details | Status code | Description | Response headers | @@ -473,10 +463,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the template files to retrieve. | | @@ -494,7 +483,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -542,10 +530,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the template files to retrieve. | | @@ -564,7 +551,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -612,10 +598,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the Template to retrieve. | | @@ -633,7 +618,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -683,10 +667,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `account_id` | **str** | Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. | [optional] | @@ -707,7 +690,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -759,10 +741,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The id of the Template to remove the Account's access to. | | @@ -781,7 +762,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -833,10 +813,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `template_id` | **str** | The ID of the template whose files to update. | | @@ -855,7 +834,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/TemplateCreateEmbeddedDraftRequest.md b/docs/TemplateCreateEmbeddedDraftRequest.md index db0ae98..2f25737 100644 --- a/docs/TemplateCreateEmbeddedDraftRequest.md +++ b/docs/TemplateCreateEmbeddedDraftRequest.md @@ -3,36 +3,33 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | -| `file_urls` | ```[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `allow_ccs` | ```bool``` | This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. | [default to True] | | `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to False] | -| `attachments` | [```[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | -| `cc_roles` | ```[str]``` | The CC roles that must be assigned when using the template to send a signature request | | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_roles` | ```List[str]``` | The CC roles that must be assigned when using the template to send a signature request | | | `editor_options` | [```SubEditorOptions```](SubEditorOptions.md) | | | | `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | | `force_signer_roles` | ```bool``` | Provide users the ability to review/edit the template signer roles. | [default to False] | | `force_subject_message` | ```bool``` | Provide users the ability to review/edit the template subject and message. | [default to False] | -| `form_field_groups` | [```[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | -| `form_field_rules` | [```[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | -| `form_fields_per_document` | [```[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | -| `merge_fields` | [```[SubMergeField]```](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `merge_fields` | [```List[SubMergeField]```](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | | | `message` | ```str``` | The default template email message. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `show_preview` | ```bool``` | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | [default to False] | | `show_progress_stepper` | ```bool``` | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [default to True] | -| `signer_roles` | [```[SubTemplateRole]```](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | +| `signer_roles` | [```List[SubTemplateRole]```](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | | `skip_me_now` | ```bool``` | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [default to False] | | `subject` | ```str``` | The template title (alias). | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | | `use_preexisting_fields` | ```bool``` | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateCreateEmbeddedDraftResponse.md b/docs/TemplateCreateEmbeddedDraftResponse.md index 3014a27..d0bfc77 100644 --- a/docs/TemplateCreateEmbeddedDraftResponse.md +++ b/docs/TemplateCreateEmbeddedDraftResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template` | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template`*_required_ | [```TemplateCreateEmbeddedDraftResponseTemplate```](TemplateCreateEmbeddedDraftResponseTemplate.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateCreateEmbeddedDraftResponseTemplate.md b/docs/TemplateCreateEmbeddedDraftResponseTemplate.md index 2545172..56b48ec 100644 --- a/docs/TemplateCreateEmbeddedDraftResponseTemplate.md +++ b/docs/TemplateCreateEmbeddedDraftResponseTemplate.md @@ -3,15 +3,12 @@ Template object with parameters: `template_id`, `edit_url`, `expires_at`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `template_id` | ```str``` | The id of the Template. | | | `edit_url` | ```str``` | Link to edit the template. | | | `expires_at` | ```int``` | When the link expires. | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateCreateRequest.md b/docs/TemplateCreateRequest.md index b79634a..ec9fb40 100644 --- a/docs/TemplateCreateRequest.md +++ b/docs/TemplateCreateRequest.md @@ -3,29 +3,26 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `form_fields_per_document`*_required_ | [```[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | -| `signer_roles`*_required_ | [```[SubTemplateRole]```](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | -| `file_urls` | ```[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `form_fields_per_document`*_required_ | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `signer_roles`*_required_ | [```List[SubTemplateRole]```](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to False] | -| `attachments` | [```[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | -| `cc_roles` | ```[str]``` | The CC roles that must be assigned when using the template to send a signature request | | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_roles` | ```List[str]``` | The CC roles that must be assigned when using the template to send a signature request | | | `client_id` | ```str``` | Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. | | | `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | -| `form_field_groups` | [```[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | -| `form_field_rules` | [```[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | -| `merge_fields` | [```[SubMergeField]```](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `merge_fields` | [```List[SubMergeField]```](SubMergeField.md) | Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document. | | | `message` | ```str``` | The default template email message. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `subject` | ```str``` | The template title (alias). | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `title` | ```str``` | The title you want to assign to the SignatureRequest. | | | `use_preexisting_fields` | ```bool``` | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateCreateResponse.md b/docs/TemplateCreateResponse.md index 742a854..466455c 100644 --- a/docs/TemplateCreateResponse.md +++ b/docs/TemplateCreateResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template` | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template`*_required_ | [```TemplateCreateResponseTemplate```](TemplateCreateResponseTemplate.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateCreateResponseTemplate.md b/docs/TemplateCreateResponseTemplate.md index a26dab4..1c3d76f 100644 --- a/docs/TemplateCreateResponseTemplate.md +++ b/docs/TemplateCreateResponseTemplate.md @@ -3,12 +3,9 @@ Template object with parameters: `template_id`. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `template_id` | ```str``` | The id of the Template. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateEditResponse.md b/docs/TemplateEditResponse.md index d4405b3..acc73fb 100644 --- a/docs/TemplateEditResponse.md +++ b/docs/TemplateEditResponse.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template_id` | ```str``` | The id of the Template. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template_id`*_required_ | ```str``` | The id of the Template. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateGetResponse.md b/docs/TemplateGetResponse.md index 2e72a15..05a0b24 100644 --- a/docs/TemplateGetResponse.md +++ b/docs/TemplateGetResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template` | [```TemplateResponse```](TemplateResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template`*_required_ | [```TemplateResponse```](TemplateResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateListResponse.md b/docs/TemplateListResponse.md index 305855f..60fb194 100644 --- a/docs/TemplateListResponse.md +++ b/docs/TemplateListResponse.md @@ -3,14 +3,11 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `templates` | [```[TemplateResponse]```](TemplateResponse.md) | List of templates that the API caller has access to. | | -| `list_info` | [```ListInfoResponse```](ListInfoResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `templates`*_required_ | [```List[TemplateResponse]```](TemplateResponse.md) | List of templates that the API caller has access to. | | +| `list_info`*_required_ | [```ListInfoResponse```](ListInfoResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateRemoveUserRequest.md b/docs/TemplateRemoveUserRequest.md index a4782eb..36b2de0 100644 --- a/docs/TemplateRemoveUserRequest.md +++ b/docs/TemplateRemoveUserRequest.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | | | `email_address` | ```str``` | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponse.md b/docs/TemplateResponse.md index 4da8047..7fb5ced 100644 --- a/docs/TemplateResponse.md +++ b/docs/TemplateResponse.md @@ -3,26 +3,23 @@ Contains information about the templates you and your team have created. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `template_id` | ```str``` | The id of the Template. | | | `title` | ```str``` | The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | | | `message` | ```str``` | The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest. | | | `updated_at` | ```int``` | Time the template was last updated. | | -| `is_embedded` | ```bool, none_type``` | `true` if this template was created using an embedded flow, `false` if it was created on our website. | | -| `is_creator` | ```bool, none_type``` | `true` if you are the owner of this template, `false` if it's been shared with you by a team member. | | -| `can_edit` | ```bool, none_type``` | Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). | | -| `is_locked` | ```bool, none_type``` | Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests. | | -| `metadata` | [```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}```](.md) | The metadata attached to the template. | | -| `signer_roles` | [```[TemplateResponseSignerRole]```](TemplateResponseSignerRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | -| `cc_roles` | [```[TemplateResponseCCRole]```](TemplateResponseCCRole.md) | An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. | | -| `documents` | [```[TemplateResponseDocument]```](TemplateResponseDocument.md) | An array describing each document associated with this Template. Includes form field data for each document. | | -| `custom_fields` | [```[TemplateResponseDocumentCustomFieldBase], none_type```](TemplateResponseDocumentCustomFieldBase.md) | Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | | -| `named_form_fields` | [```[TemplateResponseDocumentFormFieldBase], none_type```](TemplateResponseDocumentFormFieldBase.md) | Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | | -| `accounts` | [```[TemplateResponseAccount], none_type```](TemplateResponseAccount.md) | An array of the Accounts that can use this Template. | | - +| `is_embedded` | ```bool``` | `true` if this template was created using an embedded flow, `false` if it was created on our website. | | +| `is_creator` | ```bool``` | `true` if you are the owner of this template, `false` if it's been shared with you by a team member. | | +| `can_edit` | ```bool``` | Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). | | +| `is_locked` | ```bool``` | Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests. | | +| `metadata` | ```object``` | The metadata attached to the template. | | +| `signer_roles` | [```List[TemplateResponseSignerRole]```](TemplateResponseSignerRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | | +| `cc_roles` | [```List[TemplateResponseCCRole]```](TemplateResponseCCRole.md) | An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. | | +| `documents` | [```List[TemplateResponseDocument]```](TemplateResponseDocument.md) | An array describing each document associated with this Template. Includes form field data for each document. | | +| `custom_fields` | [```List[TemplateResponseDocumentCustomFieldBase]```](TemplateResponseDocumentCustomFieldBase.md) | Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | | +| `named_form_fields` | [```List[TemplateResponseDocumentFormFieldBase]```](TemplateResponseDocumentFormFieldBase.md) | Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. | | +| `accounts` | [```List[TemplateResponseAccount]```](TemplateResponseAccount.md) | An array of the Accounts that can use this Template. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseAccount.md b/docs/TemplateResponseAccount.md index ea5942d..7668fc7 100644 --- a/docs/TemplateResponseAccount.md +++ b/docs/TemplateResponseAccount.md @@ -3,9 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `account_id` | ```str``` | The id of the Account. | | | `email_address` | ```str``` | The email address associated with the Account. | | | `is_locked` | ```bool``` | Returns `true` if the user has been locked out of their account by a team admin. | | @@ -13,7 +12,5 @@ | `is_paid_hf` | ```bool``` | Returns `true` if the user has a paid HelloFax account. | | | `quotas` | [```TemplateResponseAccountQuota```](TemplateResponseAccountQuota.md) | | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseAccountQuota.md b/docs/TemplateResponseAccountQuota.md index 3a3cbb9..7e83dcc 100644 --- a/docs/TemplateResponseAccountQuota.md +++ b/docs/TemplateResponseAccountQuota.md @@ -3,15 +3,12 @@ An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `templates_left` | ```int``` | API templates remaining. | | | `api_signature_requests_left` | ```int``` | API signature requests remaining. | | | `documents_left` | ```int``` | Signature requests remaining. | | | `sms_verifications_left` | ```int``` | SMS verifications remaining. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseCCRole.md b/docs/TemplateResponseCCRole.md index 3f963b6..1aa9fa7 100644 --- a/docs/TemplateResponseCCRole.md +++ b/docs/TemplateResponseCCRole.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The name of the Role. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocument.md b/docs/TemplateResponseDocument.md index d45af8e..8071995 100644 --- a/docs/TemplateResponseDocument.md +++ b/docs/TemplateResponseDocument.md @@ -3,17 +3,14 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | Name of the associated file. | | | `index` | ```int``` | Document ordering, the lowest index is displayed first and the highest last (0-based indexing). | | -| `field_groups` | [```[TemplateResponseDocumentFieldGroup]```](TemplateResponseDocumentFieldGroup.md) | An array of Form Field Group objects. | | -| `form_fields` | [```[TemplateResponseDocumentFormFieldBase]```](TemplateResponseDocumentFormFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | | -| `custom_fields` | [```[TemplateResponseDocumentCustomFieldBase]```](TemplateResponseDocumentCustomFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | | -| `static_fields` | [```[TemplateResponseDocumentStaticFieldBase], none_type```](TemplateResponseDocumentStaticFieldBase.md) | An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. | | - +| `field_groups` | [```List[TemplateResponseDocumentFieldGroup]```](TemplateResponseDocumentFieldGroup.md) | An array of Form Field Group objects. | | +| `form_fields` | [```List[TemplateResponseDocumentFormFieldBase]```](TemplateResponseDocumentFormFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | | +| `custom_fields` | [```List[TemplateResponseDocumentCustomFieldBase]```](TemplateResponseDocumentCustomFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | | +| `static_fields` | [```List[TemplateResponseDocumentStaticFieldBase]```](TemplateResponseDocumentStaticFieldBase.md) | An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentCustomFieldBase.md b/docs/TemplateResponseDocumentCustomFieldBase.md index c05c9f7..83354a3 100644 --- a/docs/TemplateResponseDocumentCustomFieldBase.md +++ b/docs/TemplateResponseDocumentCustomFieldBase.md @@ -3,21 +3,18 @@ An array of Form Field objects containing the name and type of each named field. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `type`*_required_ | ```str``` | | | | `api_id` | ```str``` | The unique ID for this field. | | | `name` | ```str``` | The name of the Custom Field. | | -| `signer` | ```str, none_type``` | The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). | | +| `signer` | ```str``` | The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). | | | `x` | ```int``` | The horizontal offset in pixels for this form field. | | | `y` | ```int``` | The vertical offset in pixels for this form field. | | | `width` | ```int``` | The width in pixels of this form field. | | | `height` | ```int``` | The height in pixels of this form field. | | | `required` | ```bool``` | Boolean showing whether or not this field is required. | | -| `group` | ```str, none_type``` | The name of the group this field is in. If this field is not a group, this defaults to `null`. | | - +| `group` | ```str``` | The name of the group this field is in. If this field is not a group, this defaults to `null`. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentCustomFieldCheckbox.md b/docs/TemplateResponseDocumentCustomFieldCheckbox.md index b0f7e60..0bbf24c 100644 --- a/docs/TemplateResponseDocumentCustomFieldCheckbox.md +++ b/docs/TemplateResponseDocumentCustomFieldCheckbox.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentCustomFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to "checkbox"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to 'checkbox'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentCustomFieldText.md b/docs/TemplateResponseDocumentCustomFieldText.md index a219739..474097e 100644 --- a/docs/TemplateResponseDocumentCustomFieldText.md +++ b/docs/TemplateResponseDocumentCustomFieldText.md @@ -3,16 +3,13 @@ This class extends `TemplateResponseDocumentCustomFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to "text"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to 'text'] | | `avg_text_length` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `is_multiline` | ```bool``` | Whether this form field is multiline text. | | | `original_font_size` | ```int``` | Original font size used in this form field's text. | | | `font_family` | ```str``` | Font family used in this form field's text. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentFieldGroup.md b/docs/TemplateResponseDocumentFieldGroup.md index f35b445..29a19c7 100644 --- a/docs/TemplateResponseDocumentFieldGroup.md +++ b/docs/TemplateResponseDocumentFieldGroup.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The name of the form field group. | | | `rule` | [```TemplateResponseDocumentFieldGroupRule```](TemplateResponseDocumentFieldGroupRule.md) | | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentFieldGroupRule.md b/docs/TemplateResponseDocumentFieldGroupRule.md index 06a8393..3f0a44f 100644 --- a/docs/TemplateResponseDocumentFieldGroupRule.md +++ b/docs/TemplateResponseDocumentFieldGroupRule.md @@ -3,13 +3,10 @@ The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping). ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `requirement` | ```str``` | Examples: `require_0-1` `require_1` `require_1-ormore`

- Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. | | | `group_label` | ```str``` | Name of the group | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentFormFieldBase.md b/docs/TemplateResponseDocumentFormFieldBase.md index bb4b91a..b8aecfa 100644 --- a/docs/TemplateResponseDocumentFormFieldBase.md +++ b/docs/TemplateResponseDocumentFormFieldBase.md @@ -3,9 +3,8 @@ An array of Form Field objects containing the name and type of each named field. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `type`*_required_ | ```str``` | | | | `api_id` | ```str``` | A unique id for the form field. | | | `name` | ```str``` | The name of the form field. | | @@ -15,9 +14,7 @@ An array of Form Field objects containing the name and type of each named field. | `width` | ```int``` | The width in pixels of this form field. | | | `height` | ```int``` | The height in pixels of this form field. | | | `required` | ```bool``` | Boolean showing whether or not this field is required. | | -| `group` | ```str, none_type``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | | - +| `group` | ```str``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentFormFieldCheckbox.md b/docs/TemplateResponseDocumentFormFieldCheckbox.md index 6aad7ac..6d35e1c 100644 --- a/docs/TemplateResponseDocumentFormFieldCheckbox.md +++ b/docs/TemplateResponseDocumentFormFieldCheckbox.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "checkbox"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'checkbox'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentFormFieldDateSigned.md b/docs/TemplateResponseDocumentFormFieldDateSigned.md index a07b7f3..863ed11 100644 --- a/docs/TemplateResponseDocumentFormFieldDateSigned.md +++ b/docs/TemplateResponseDocumentFormFieldDateSigned.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "date_signed"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'date_signed'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentFormFieldDropdown.md b/docs/TemplateResponseDocumentFormFieldDropdown.md index 155e1e3..99d0733 100644 --- a/docs/TemplateResponseDocumentFormFieldDropdown.md +++ b/docs/TemplateResponseDocumentFormFieldDropdown.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "dropdown"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'dropdown'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentFormFieldHyperlink.md b/docs/TemplateResponseDocumentFormFieldHyperlink.md index b1e73fa..dd7db8d 100644 --- a/docs/TemplateResponseDocumentFormFieldHyperlink.md +++ b/docs/TemplateResponseDocumentFormFieldHyperlink.md @@ -3,16 +3,13 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "hyperlink"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'hyperlink'] | | `avg_text_length` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `is_multiline` | ```bool``` | Whether this form field is multiline text. | | | `original_font_size` | ```int``` | Original font size used in this form field's text. | | | `font_family` | ```str``` | Font family used in this form field's text. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentFormFieldInitials.md b/docs/TemplateResponseDocumentFormFieldInitials.md index 86c5942..80cc522 100644 --- a/docs/TemplateResponseDocumentFormFieldInitials.md +++ b/docs/TemplateResponseDocumentFormFieldInitials.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "initials"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'initials'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentFormFieldRadio.md b/docs/TemplateResponseDocumentFormFieldRadio.md index 5a69222..af3e60e 100644 --- a/docs/TemplateResponseDocumentFormFieldRadio.md +++ b/docs/TemplateResponseDocumentFormFieldRadio.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "radio"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'radio'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentFormFieldSignature.md b/docs/TemplateResponseDocumentFormFieldSignature.md index 6b33dd7..304eaf5 100644 --- a/docs/TemplateResponseDocumentFormFieldSignature.md +++ b/docs/TemplateResponseDocumentFormFieldSignature.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "signature"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'signature'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentFormFieldText.md b/docs/TemplateResponseDocumentFormFieldText.md index b4214e3..bafb6e3 100644 --- a/docs/TemplateResponseDocumentFormFieldText.md +++ b/docs/TemplateResponseDocumentFormFieldText.md @@ -3,17 +3,14 @@ This class extends `TemplateResponseDocumentFormFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to "text"] | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this form field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentFormFieldText`
* Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentFormFieldRadio`
* Signature Field uses `TemplateResponseDocumentFormFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentFormFieldInitials` | [default to 'text'] | | `avg_text_length` | [```TemplateResponseFieldAvgTextLength```](TemplateResponseFieldAvgTextLength.md) | | | | `is_multiline` | ```bool``` | Whether this form field is multiline text. | | | `original_font_size` | ```int``` | Original font size used in this form field's text. | | | `font_family` | ```str``` | Font family used in this form field's text. | | -| `validation_type` | ```str, none_type``` | Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. | | - +| `validation_type` | ```str``` | Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentStaticFieldBase.md b/docs/TemplateResponseDocumentStaticFieldBase.md index 1b4ad53..a7347b6 100644 --- a/docs/TemplateResponseDocumentStaticFieldBase.md +++ b/docs/TemplateResponseDocumentStaticFieldBase.md @@ -3,21 +3,18 @@ An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `type`*_required_ | ```str``` | | | | `api_id` | ```str``` | A unique id for the static field. | | | `name` | ```str``` | The name of the static field. | | -| `signer` | ```str``` | The signer of the Static Field. | [default to "me_now"] | +| `signer` | ```str``` | The signer of the Static Field. | [default to 'me_now'] | | `x` | ```int``` | The horizontal offset in pixels for this static field. | | | `y` | ```int``` | The vertical offset in pixels for this static field. | | | `width` | ```int``` | The width in pixels of this static field. | | | `height` | ```int``` | The height in pixels of this static field. | | | `required` | ```bool``` | Boolean showing whether or not this field is required. | | -| `group` | ```str, none_type``` | The name of the group this field is in. If this field is not a group, this defaults to `null`. | | - +| `group` | ```str``` | The name of the group this field is in. If this field is not a group, this defaults to `null`. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentStaticFieldCheckbox.md b/docs/TemplateResponseDocumentStaticFieldCheckbox.md index aed2054..a1acbb1 100644 --- a/docs/TemplateResponseDocumentStaticFieldCheckbox.md +++ b/docs/TemplateResponseDocumentStaticFieldCheckbox.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "checkbox"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'checkbox'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentStaticFieldDateSigned.md b/docs/TemplateResponseDocumentStaticFieldDateSigned.md index 8eeaa39..62c4b1e 100644 --- a/docs/TemplateResponseDocumentStaticFieldDateSigned.md +++ b/docs/TemplateResponseDocumentStaticFieldDateSigned.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "date_signed"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'date_signed'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentStaticFieldDropdown.md b/docs/TemplateResponseDocumentStaticFieldDropdown.md index d3fac79..302afcf 100644 --- a/docs/TemplateResponseDocumentStaticFieldDropdown.md +++ b/docs/TemplateResponseDocumentStaticFieldDropdown.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "dropdown"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'dropdown'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentStaticFieldHyperlink.md b/docs/TemplateResponseDocumentStaticFieldHyperlink.md index c7c08bf..52e93c2 100644 --- a/docs/TemplateResponseDocumentStaticFieldHyperlink.md +++ b/docs/TemplateResponseDocumentStaticFieldHyperlink.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "hyperlink"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'hyperlink'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentStaticFieldInitials.md b/docs/TemplateResponseDocumentStaticFieldInitials.md index f60380d..227f77c 100644 --- a/docs/TemplateResponseDocumentStaticFieldInitials.md +++ b/docs/TemplateResponseDocumentStaticFieldInitials.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "initials"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'initials'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentStaticFieldRadio.md b/docs/TemplateResponseDocumentStaticFieldRadio.md index 1274162..8002b86 100644 --- a/docs/TemplateResponseDocumentStaticFieldRadio.md +++ b/docs/TemplateResponseDocumentStaticFieldRadio.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "radio"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'radio'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentStaticFieldSignature.md b/docs/TemplateResponseDocumentStaticFieldSignature.md index a9496a9..4433280 100644 --- a/docs/TemplateResponseDocumentStaticFieldSignature.md +++ b/docs/TemplateResponseDocumentStaticFieldSignature.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "signature"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'signature'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseDocumentStaticFieldText.md b/docs/TemplateResponseDocumentStaticFieldText.md index 89c3cff..1988dc8 100644 --- a/docs/TemplateResponseDocumentStaticFieldText.md +++ b/docs/TemplateResponseDocumentStaticFieldText.md @@ -3,12 +3,9 @@ This class extends `TemplateResponseDocumentStaticFieldBase` ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to "text"] | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `type`*_required_ | ```str``` | The type of this static field. See [field types](/api/reference/constants/#field-types).

* Text Field uses `TemplateResponseDocumentStaticFieldText`
* Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown`
* Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink`
* Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox`
* Radio Field uses `TemplateResponseDocumentStaticFieldRadio`
* Signature Field uses `TemplateResponseDocumentStaticFieldSignature`
* Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned`
* Initials Field uses `TemplateResponseDocumentStaticFieldInitials` | [default to 'text'] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseFieldAvgTextLength.md b/docs/TemplateResponseFieldAvgTextLength.md index 07c94cb..f50991c 100644 --- a/docs/TemplateResponseFieldAvgTextLength.md +++ b/docs/TemplateResponseFieldAvgTextLength.md @@ -3,13 +3,10 @@ Average text length in this field. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `num_lines` | ```int``` | Number of lines. | | | `num_chars_per_line` | ```int``` | Number of characters per line. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateResponseSignerRole.md b/docs/TemplateResponseSignerRole.md index f4e0d45..7a65a36 100644 --- a/docs/TemplateResponseSignerRole.md +++ b/docs/TemplateResponseSignerRole.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `name` | ```str``` | The name of the Role. | | | `order` | ```int``` | If signer order is assigned this is the 0-based index for this role. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateUpdateFilesRequest.md b/docs/TemplateUpdateFilesRequest.md index f3a429f..7122fad 100644 --- a/docs/TemplateUpdateFilesRequest.md +++ b/docs/TemplateUpdateFilesRequest.md @@ -3,17 +3,14 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id` | ```str``` | Client id of the app you're using to update this template. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to use for the template.

This endpoint requires either **files** or **file_urls[]**, but not both. | | -| `file_urls` | ```[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to use for the template.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template.

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `message` | ```str``` | The new default template email message. | | | `subject` | ```str``` | The new default template email subject. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateUpdateFilesResponse.md b/docs/TemplateUpdateFilesResponse.md index 254d949..75af64c 100644 --- a/docs/TemplateUpdateFilesResponse.md +++ b/docs/TemplateUpdateFilesResponse.md @@ -3,12 +3,9 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `template` | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `template`*_required_ | [```TemplateUpdateFilesResponseTemplate```](TemplateUpdateFilesResponseTemplate.md) | | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TemplateUpdateFilesResponseTemplate.md b/docs/TemplateUpdateFilesResponseTemplate.md index 3dbc339..27ea317 100644 --- a/docs/TemplateUpdateFilesResponseTemplate.md +++ b/docs/TemplateUpdateFilesResponseTemplate.md @@ -3,13 +3,10 @@ Contains template id ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `template_id` | ```str``` | The id of the Template. | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/UnclaimedDraftApi.md b/docs/UnclaimedDraftApi.md index 3aa6a49..03e8228 100644 --- a/docs/UnclaimedDraftApi.md +++ b/docs/UnclaimedDraftApi.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.hellosign.com/v3* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- |[```unclaimed_draft_create```](UnclaimedDraftApi.md#unclaimed_draft_create) | ```POST /unclaimed_draft/create``` | Create Unclaimed Draft| |[```unclaimed_draft_create_embedded```](UnclaimedDraftApi.md#unclaimed_draft_create_embedded) | ```POST /unclaimed_draft/create_embedded``` | Create Embedded Unclaimed Draft| |[```unclaimed_draft_create_embedded_with_template```](UnclaimedDraftApi.md#unclaimed_draft_create_embedded_with_template) | ```POST /unclaimed_draft/create_embedded_with_template``` | Create Embedded Unclaimed Draft with Template| @@ -89,10 +89,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `unclaimed_draft_create_request` | [**UnclaimedDraftCreateRequest**](UnclaimedDraftCreateRequest.md) | | | @@ -110,7 +109,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -163,10 +161,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `unclaimed_draft_create_embedded_request` | [**UnclaimedDraftCreateEmbeddedRequest**](UnclaimedDraftCreateEmbeddedRequest.md) | | | @@ -184,7 +181,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -250,10 +246,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `unclaimed_draft_create_embedded_with_template_request` | [**UnclaimedDraftCreateEmbeddedWithTemplateRequest**](UnclaimedDraftCreateEmbeddedWithTemplateRequest.md) | | | @@ -271,7 +266,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json, multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -324,10 +318,9 @@ with ApiClient(configuration) as api_client: print("Exception when calling Dropbox Sign API: %s\n" % e) ``` - +``` ### Parameters - | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `signature_request_id` | **str** | The ID of the signature request to edit and resend. | | @@ -346,7 +339,6 @@ with ApiClient(configuration) as api_client: - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/UnclaimedDraftCreateEmbeddedRequest.md b/docs/UnclaimedDraftCreateEmbeddedRequest.md index 94e5e04..bc81c3c 100644 --- a/docs/UnclaimedDraftCreateEmbeddedRequest.md +++ b/docs/UnclaimedDraftCreateEmbeddedRequest.md @@ -3,47 +3,44 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `requester_email_address`*_required_ | ```str``` | The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | -| `file_urls` | ```[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `allow_ccs` | ```bool``` | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [default to True] | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | | `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to False] | -| `attachments` | [```[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | -| `cc_email_addresses` | ```[str]``` | The email addresses that should be CCed. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```List[str]``` | The email addresses that should be CCed. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | | `editor_options` | [```SubEditorOptions```](SubEditorOptions.md) | | | | `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | | `force_signer_page` | ```bool``` | Provide users the ability to review/edit the signers. | [default to False] | | `force_subject_message` | ```bool``` | Provide users the ability to review/edit the subject and message. | [default to False] | -| `form_field_groups` | [```[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | -| `form_field_rules` | [```[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | -| `form_fields_per_document` | [```[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | | `hide_text_tags` | ```bool``` | Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. | [default to False] | | `hold_request` | ```bool``` | The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. | [default to False] | | `is_for_embedded_signing` | ```bool``` | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [default to False] | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `requesting_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully request a signature. | | | `show_preview` | ```bool``` | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | | | `show_progress_stepper` | ```bool``` | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [default to True] | -| `signers` | [```[SubUnclaimedDraftSigner]```](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | | +| `signers` | [```List[SubUnclaimedDraftSigner]```](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | | | `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `skip_me_now` | ```bool``` | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [default to False] | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | -| `type` | ```str``` | The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. | [default to "request_signature"] | +| `type` | ```str``` | The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it. | [default to 'request_signature'] | | `use_preexisting_fields` | ```bool``` | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [default to False] | | `use_text_tags` | ```bool``` | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [default to False] | | `populate_auto_fill_fields` | ```bool``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to False] | -| `expires_at` | ```int, none_type``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | | - +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md b/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md index d5a2806..ef959b9 100644 --- a/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md +++ b/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md @@ -3,31 +3,30 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `requester_email_address`*_required_ | ```str``` | The email address of the user that should be designated as the requester of this draft. | | -| `template_ids`*_required_ | ```[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. | | +| `template_ids`*_required_ | ```List[str]``` | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | | `allow_reassign` | ```bool``` | Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`.

**NOTE:** Only available for Premium plan and higher. | [default to False] | -| `ccs` | [```[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | +| `ccs` | [```List[SubCC]```](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | | | `editor_options` | [```SubEditorOptions```](SubEditorOptions.md) | | | | `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | -| `files` | ```[file_type]``` | Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | | -| `file_urls` | ```[str]``` | Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | | +| `file_urls` | ```List[str]``` | Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored.

**files** or **file_urls[]** is required, but not both. | | | `force_signer_roles` | ```bool``` | Provide users the ability to review/edit the template signer roles. | [default to False] | | `force_subject_message` | ```bool``` | Provide users the ability to review/edit the template subject and message. | [default to False] | | `hold_request` | ```bool``` | The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`. | [default to False] | | `is_for_embedded_signing` | ```bool``` | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [default to False] | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `preview_only` | ```bool``` | This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor).

- `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience.

**NOTE:** This parameter overwrites `show_preview=1` (if set). | [default to False] | | `requesting_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully request a signature. | | | `show_preview` | ```bool``` | This allows the requester to enable the editor/preview experience.

- `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience. | [default to False] | | `show_progress_stepper` | ```bool``` | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [default to True] | -| `signers` | [```[SubUnclaimedDraftTemplateSigner]```](SubUnclaimedDraftTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | +| `signers` | [```List[SubUnclaimedDraftTemplateSigner]```](SubUnclaimedDraftTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | | | `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `skip_me_now` | ```bool``` | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [default to False] | @@ -37,7 +36,5 @@ | `populate_auto_fill_fields` | ```bool``` | Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing.

**NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature. | [default to False] | | `allow_ccs` | ```bool``` | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/UnclaimedDraftCreateRequest.md b/docs/UnclaimedDraftCreateRequest.md index 78379a2..61471fc 100644 --- a/docs/UnclaimedDraftCreateRequest.md +++ b/docs/UnclaimedDraftCreateRequest.md @@ -3,35 +3,32 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `type`*_required_ | ```str``` | The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. | | -| `files` | ```[file_type]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | -| `file_urls` | ```[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `files` | ```List[io.IOBase]``` | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | +| `file_urls` | ```List[str]``` | Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | | | `allow_decline` | ```bool``` | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [default to False] | -| `attachments` | [```[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | -| `cc_email_addresses` | ```[str]``` | The email addresses that should be CCed. | | +| `attachments` | [```List[SubAttachment]```](SubAttachment.md) | A list describing the attachments | | +| `cc_email_addresses` | ```List[str]``` | The email addresses that should be CCed. | | | `client_id` | ```str``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | -| `custom_fields` | [```[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | +| `custom_fields` | [```List[SubCustomField]```](SubCustomField.md) | When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests.

Pre-filled data can be used with "send-once" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call.

For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. | | | `field_options` | [```SubFieldOptions```](SubFieldOptions.md) | | | -| `form_field_groups` | [```[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | -| `form_field_rules` | [```[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | -| `form_fields_per_document` | [```[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | +| `form_field_groups` | [```List[SubFormFieldGroup]```](SubFormFieldGroup.md) | Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`. | | +| `form_field_rules` | [```List[SubFormFieldRule]```](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | | +| `form_fields_per_document` | [```List[SubFormFieldsPerDocumentBase]```](SubFormFieldsPerDocumentBase.md) | The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).)

**NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types.

* Text Field use `SubFormFieldsPerDocumentText`
* Dropdown Field use `SubFormFieldsPerDocumentDropdown`
* Hyperlink Field use `SubFormFieldsPerDocumentHyperlink`
* Checkbox Field use `SubFormFieldsPerDocumentCheckbox`
* Radio Field use `SubFormFieldsPerDocumentRadio`
* Signature Field use `SubFormFieldsPerDocumentSignature`
* Date Signed Field use `SubFormFieldsPerDocumentDateSigned`
* Initials Field use `SubFormFieldsPerDocumentInitials`
* Text Merge Field use `SubFormFieldsPerDocumentTextMerge`
* Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` | | | `hide_text_tags` | ```bool``` | Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details. | [default to False] | | `message` | ```str``` | The custom message in the email that will be sent to the signers. | | -| `metadata` | ```{str: (bool, date, datetime, dict, float, int, list, str, none_type)}``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | +| `metadata` | ```Dict[str, object]``` | Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request.

Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long. | | | `show_progress_stepper` | ```bool``` | When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. | [default to True] | -| `signers` | [```[SubUnclaimedDraftSigner]```](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | | +| `signers` | [```List[SubUnclaimedDraftSigner]```](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | | | `signing_options` | [```SubSigningOptions```](SubSigningOptions.md) | | | | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `subject` | ```str``` | The subject in the email that will be sent to the signers. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | | `use_preexisting_fields` | ```bool``` | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [default to False] | | `use_text_tags` | ```bool``` | Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both. | [default to False] | -| `expires_at` | ```int, none_type``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | | - +| `expires_at` | ```int``` | When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.

**NOTE:** This does not correspond to the **expires_at** returned in the response. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/UnclaimedDraftCreateResponse.md b/docs/UnclaimedDraftCreateResponse.md index 98222ba..bfb420c 100644 --- a/docs/UnclaimedDraftCreateResponse.md +++ b/docs/UnclaimedDraftCreateResponse.md @@ -3,13 +3,10 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `unclaimed_draft` | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | -| `warnings` | [```[WarningResponse]```](WarningResponse.md) | A list of warnings. | | - +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `unclaimed_draft`*_required_ | [```UnclaimedDraftResponse```](UnclaimedDraftResponse.md) | | | +| `warnings` | [```List[WarningResponse]```](WarningResponse.md) | A list of warnings. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/UnclaimedDraftEditAndResendRequest.md b/docs/UnclaimedDraftEditAndResendRequest.md index 6c76b3f..d13a104 100644 --- a/docs/UnclaimedDraftEditAndResendRequest.md +++ b/docs/UnclaimedDraftEditAndResendRequest.md @@ -3,9 +3,8 @@ ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `client_id`*_required_ | ```str``` | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | | | `editor_options` | [```SubEditorOptions```](SubEditorOptions.md) | | | | `is_for_embedded_signing` | ```bool``` | The request created from this draft will also be signable in embedded mode if set to `true`. | | @@ -15,7 +14,5 @@ | `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | | `test_mode` | ```bool``` | Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. | [default to False] | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/UnclaimedDraftResponse.md b/docs/UnclaimedDraftResponse.md index 8865726..2a3e4f9 100644 --- a/docs/UnclaimedDraftResponse.md +++ b/docs/UnclaimedDraftResponse.md @@ -3,17 +3,14 @@ A group of documents that a user can take ownership of via the claim URL. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| `signature_request_id` | ```str, none_type``` | The ID of the signature request that is represented by this UnclaimedDraft. | | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +| `signature_request_id` | ```str``` | The ID of the signature request that is represented by this UnclaimedDraft. | | | `claim_url` | ```str``` | The URL to be used to claim this UnclaimedDraft. | | -| `signing_redirect_url` | ```str, none_type``` | The URL you want signers redirected to after they successfully sign. | | -| `requesting_redirect_url` | ```str, none_type``` | The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.). | | -| `expires_at` | ```int, none_type``` | When the link expires. | | +| `signing_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully sign. | | +| `requesting_redirect_url` | ```str``` | The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.). | | +| `expires_at` | ```int``` | When the link expires. | | | `test_mode` | ```bool``` | Whether this is a test draft. Signature requests made from test drafts have no legal value. | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/WarningResponse.md b/docs/WarningResponse.md index 33a233d..3de57d0 100644 --- a/docs/WarningResponse.md +++ b/docs/WarningResponse.md @@ -3,13 +3,10 @@ A list of warnings. ## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- | `warning_msg`*_required_ | ```str``` | Warning message | | | `warning_name`*_required_ | ```str``` | Warning name | | - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/dropbox_sign/__init__.py b/dropbox_sign/__init__.py index b698801..f12bc0e 100644 --- a/dropbox_sign/__init__.py +++ b/dropbox_sign/__init__.py @@ -1,30 +1,218 @@ +# coding: utf-8 + # flake8: noqa """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +__version__ = "1.6.0" -__version__ = "1.5.0" +# import apis into sdk package +from dropbox_sign.apis import * # import ApiClient +from dropbox_sign.api_response import ApiResponse from dropbox_sign.api_client import ApiClient - -# import Configuration from dropbox_sign.configuration import Configuration - -# import exceptions from dropbox_sign.exceptions import OpenApiException -from dropbox_sign.exceptions import ApiAttributeError from dropbox_sign.exceptions import ApiTypeError from dropbox_sign.exceptions import ApiValueError from dropbox_sign.exceptions import ApiKeyError +from dropbox_sign.exceptions import ApiAttributeError from dropbox_sign.exceptions import ApiException +# import models into sdk package +from dropbox_sign.models.account_create_request import AccountCreateRequest +from dropbox_sign.models.account_create_response import AccountCreateResponse +from dropbox_sign.models.account_get_response import AccountGetResponse +from dropbox_sign.models.account_response import AccountResponse +from dropbox_sign.models.account_response_quotas import AccountResponseQuotas +from dropbox_sign.models.account_response_usage import AccountResponseUsage +from dropbox_sign.models.account_update_request import AccountUpdateRequest +from dropbox_sign.models.account_verify_request import AccountVerifyRequest +from dropbox_sign.models.account_verify_response import AccountVerifyResponse +from dropbox_sign.models.account_verify_response_account import AccountVerifyResponseAccount +from dropbox_sign.models.api_app_create_request import ApiAppCreateRequest +from dropbox_sign.models.api_app_get_response import ApiAppGetResponse +from dropbox_sign.models.api_app_list_response import ApiAppListResponse +from dropbox_sign.models.api_app_response import ApiAppResponse +from dropbox_sign.models.api_app_response_o_auth import ApiAppResponseOAuth +from dropbox_sign.models.api_app_response_options import ApiAppResponseOptions +from dropbox_sign.models.api_app_response_owner_account import ApiAppResponseOwnerAccount +from dropbox_sign.models.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions +from dropbox_sign.models.api_app_update_request import ApiAppUpdateRequest +from dropbox_sign.models.bulk_send_job_get_response import BulkSendJobGetResponse +from dropbox_sign.models.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests +from dropbox_sign.models.bulk_send_job_list_response import BulkSendJobListResponse +from dropbox_sign.models.bulk_send_job_response import BulkSendJobResponse +from dropbox_sign.models.bulk_send_job_send_response import BulkSendJobSendResponse +from dropbox_sign.models.embedded_edit_url_request import EmbeddedEditUrlRequest +from dropbox_sign.models.embedded_edit_url_response import EmbeddedEditUrlResponse +from dropbox_sign.models.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded +from dropbox_sign.models.embedded_sign_url_response import EmbeddedSignUrlResponse +from dropbox_sign.models.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded +from dropbox_sign.models.error_response import ErrorResponse +from dropbox_sign.models.error_response_error import ErrorResponseError +from dropbox_sign.models.event_callback_request import EventCallbackRequest +from dropbox_sign.models.event_callback_request_event import EventCallbackRequestEvent +from dropbox_sign.models.event_callback_request_event_metadata import EventCallbackRequestEventMetadata +from dropbox_sign.models.fax_line_add_user_request import FaxLineAddUserRequest +from dropbox_sign.models.fax_line_area_code_get_country_enum import FaxLineAreaCodeGetCountryEnum +from dropbox_sign.models.fax_line_area_code_get_province_enum import FaxLineAreaCodeGetProvinceEnum +from dropbox_sign.models.fax_line_area_code_get_response import FaxLineAreaCodeGetResponse +from dropbox_sign.models.fax_line_area_code_get_state_enum import FaxLineAreaCodeGetStateEnum +from dropbox_sign.models.fax_line_create_request import FaxLineCreateRequest +from dropbox_sign.models.fax_line_delete_request import FaxLineDeleteRequest +from dropbox_sign.models.fax_line_list_response import FaxLineListResponse +from dropbox_sign.models.fax_line_remove_user_request import FaxLineRemoveUserRequest +from dropbox_sign.models.fax_line_response import FaxLineResponse +from dropbox_sign.models.fax_line_response_fax_line import FaxLineResponseFaxLine +from dropbox_sign.models.file_response import FileResponse +from dropbox_sign.models.file_response_data_uri import FileResponseDataUri +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.o_auth_token_generate_request import OAuthTokenGenerateRequest +from dropbox_sign.models.o_auth_token_refresh_request import OAuthTokenRefreshRequest +from dropbox_sign.models.o_auth_token_response import OAuthTokenResponse +from dropbox_sign.models.report_create_request import ReportCreateRequest +from dropbox_sign.models.report_create_response import ReportCreateResponse +from dropbox_sign.models.report_response import ReportResponse +from dropbox_sign.models.signature_request_bulk_create_embedded_with_template_request import SignatureRequestBulkCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_bulk_send_with_template_request import SignatureRequestBulkSendWithTemplateRequest +from dropbox_sign.models.signature_request_create_embedded_request import SignatureRequestCreateEmbeddedRequest +from dropbox_sign.models.signature_request_create_embedded_with_template_request import SignatureRequestCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_get_response import SignatureRequestGetResponse +from dropbox_sign.models.signature_request_list_response import SignatureRequestListResponse +from dropbox_sign.models.signature_request_remind_request import SignatureRequestRemindRequest +from dropbox_sign.models.signature_request_response import SignatureRequestResponse +from dropbox_sign.models.signature_request_response_attachment import SignatureRequestResponseAttachment +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from dropbox_sign.models.signature_request_response_custom_field_checkbox import SignatureRequestResponseCustomFieldCheckbox +from dropbox_sign.models.signature_request_response_custom_field_text import SignatureRequestResponseCustomFieldText +from dropbox_sign.models.signature_request_response_custom_field_type_enum import SignatureRequestResponseCustomFieldTypeEnum +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from dropbox_sign.models.signature_request_response_data_type_enum import SignatureRequestResponseDataTypeEnum +from dropbox_sign.models.signature_request_response_data_value_checkbox import SignatureRequestResponseDataValueCheckbox +from dropbox_sign.models.signature_request_response_data_value_checkbox_merge import SignatureRequestResponseDataValueCheckboxMerge +from dropbox_sign.models.signature_request_response_data_value_date_signed import SignatureRequestResponseDataValueDateSigned +from dropbox_sign.models.signature_request_response_data_value_dropdown import SignatureRequestResponseDataValueDropdown +from dropbox_sign.models.signature_request_response_data_value_initials import SignatureRequestResponseDataValueInitials +from dropbox_sign.models.signature_request_response_data_value_radio import SignatureRequestResponseDataValueRadio +from dropbox_sign.models.signature_request_response_data_value_signature import SignatureRequestResponseDataValueSignature +from dropbox_sign.models.signature_request_response_data_value_text import SignatureRequestResponseDataValueText +from dropbox_sign.models.signature_request_response_data_value_text_merge import SignatureRequestResponseDataValueTextMerge +from dropbox_sign.models.signature_request_response_signatures import SignatureRequestResponseSignatures +from dropbox_sign.models.signature_request_send_request import SignatureRequestSendRequest +from dropbox_sign.models.signature_request_send_with_template_request import SignatureRequestSendWithTemplateRequest +from dropbox_sign.models.signature_request_update_request import SignatureRequestUpdateRequest +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_bulk_signer_list import SubBulkSignerList +from dropbox_sign.models.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_field_rule_action import SubFormFieldRuleAction +from dropbox_sign.models.sub_form_field_rule_trigger import SubFormFieldRuleTrigger +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_form_fields_per_document_checkbox import SubFormFieldsPerDocumentCheckbox +from dropbox_sign.models.sub_form_fields_per_document_checkbox_merge import SubFormFieldsPerDocumentCheckboxMerge +from dropbox_sign.models.sub_form_fields_per_document_date_signed import SubFormFieldsPerDocumentDateSigned +from dropbox_sign.models.sub_form_fields_per_document_dropdown import SubFormFieldsPerDocumentDropdown +from dropbox_sign.models.sub_form_fields_per_document_font_enum import SubFormFieldsPerDocumentFontEnum +from dropbox_sign.models.sub_form_fields_per_document_hyperlink import SubFormFieldsPerDocumentHyperlink +from dropbox_sign.models.sub_form_fields_per_document_initials import SubFormFieldsPerDocumentInitials +from dropbox_sign.models.sub_form_fields_per_document_radio import SubFormFieldsPerDocumentRadio +from dropbox_sign.models.sub_form_fields_per_document_signature import SubFormFieldsPerDocumentSignature +from dropbox_sign.models.sub_form_fields_per_document_text import SubFormFieldsPerDocumentText +from dropbox_sign.models.sub_form_fields_per_document_text_merge import SubFormFieldsPerDocumentTextMerge +from dropbox_sign.models.sub_form_fields_per_document_type_enum import SubFormFieldsPerDocumentTypeEnum +from dropbox_sign.models.sub_merge_field import SubMergeField +from dropbox_sign.models.sub_o_auth import SubOAuth +from dropbox_sign.models.sub_options import SubOptions +from dropbox_sign.models.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners +from dropbox_sign.models.sub_signature_request_signer import SubSignatureRequestSigner +from dropbox_sign.models.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from dropbox_sign.models.sub_team_response import SubTeamResponse +from dropbox_sign.models.sub_template_role import SubTemplateRole +from dropbox_sign.models.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner +from dropbox_sign.models.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner +from dropbox_sign.models.sub_white_labeling_options import SubWhiteLabelingOptions +from dropbox_sign.models.team_add_member_request import TeamAddMemberRequest +from dropbox_sign.models.team_create_request import TeamCreateRequest +from dropbox_sign.models.team_get_info_response import TeamGetInfoResponse +from dropbox_sign.models.team_get_response import TeamGetResponse +from dropbox_sign.models.team_info_response import TeamInfoResponse +from dropbox_sign.models.team_invite_response import TeamInviteResponse +from dropbox_sign.models.team_invites_response import TeamInvitesResponse +from dropbox_sign.models.team_member_response import TeamMemberResponse +from dropbox_sign.models.team_members_response import TeamMembersResponse +from dropbox_sign.models.team_parent_response import TeamParentResponse +from dropbox_sign.models.team_remove_member_request import TeamRemoveMemberRequest +from dropbox_sign.models.team_response import TeamResponse +from dropbox_sign.models.team_sub_teams_response import TeamSubTeamsResponse +from dropbox_sign.models.team_update_request import TeamUpdateRequest +from dropbox_sign.models.template_add_user_request import TemplateAddUserRequest +from dropbox_sign.models.template_create_embedded_draft_request import TemplateCreateEmbeddedDraftRequest +from dropbox_sign.models.template_create_embedded_draft_response import TemplateCreateEmbeddedDraftResponse +from dropbox_sign.models.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate +from dropbox_sign.models.template_create_request import TemplateCreateRequest +from dropbox_sign.models.template_create_response import TemplateCreateResponse +from dropbox_sign.models.template_create_response_template import TemplateCreateResponseTemplate +from dropbox_sign.models.template_edit_response import TemplateEditResponse +from dropbox_sign.models.template_get_response import TemplateGetResponse +from dropbox_sign.models.template_list_response import TemplateListResponse +from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest +from dropbox_sign.models.template_response import TemplateResponse +from dropbox_sign.models.template_response_account import TemplateResponseAccount +from dropbox_sign.models.template_response_account_quota import TemplateResponseAccountQuota +from dropbox_sign.models.template_response_cc_role import TemplateResponseCCRole +from dropbox_sign.models.template_response_document import TemplateResponseDocument +from dropbox_sign.models.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from dropbox_sign.models.template_response_document_custom_field_checkbox import TemplateResponseDocumentCustomFieldCheckbox +from dropbox_sign.models.template_response_document_custom_field_text import TemplateResponseDocumentCustomFieldText +from dropbox_sign.models.template_response_document_field_group import TemplateResponseDocumentFieldGroup +from dropbox_sign.models.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_document_form_field_checkbox import TemplateResponseDocumentFormFieldCheckbox +from dropbox_sign.models.template_response_document_form_field_date_signed import TemplateResponseDocumentFormFieldDateSigned +from dropbox_sign.models.template_response_document_form_field_dropdown import TemplateResponseDocumentFormFieldDropdown +from dropbox_sign.models.template_response_document_form_field_hyperlink import TemplateResponseDocumentFormFieldHyperlink +from dropbox_sign.models.template_response_document_form_field_initials import TemplateResponseDocumentFormFieldInitials +from dropbox_sign.models.template_response_document_form_field_radio import TemplateResponseDocumentFormFieldRadio +from dropbox_sign.models.template_response_document_form_field_signature import TemplateResponseDocumentFormFieldSignature +from dropbox_sign.models.template_response_document_form_field_text import TemplateResponseDocumentFormFieldText +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from dropbox_sign.models.template_response_document_static_field_checkbox import TemplateResponseDocumentStaticFieldCheckbox +from dropbox_sign.models.template_response_document_static_field_date_signed import TemplateResponseDocumentStaticFieldDateSigned +from dropbox_sign.models.template_response_document_static_field_dropdown import TemplateResponseDocumentStaticFieldDropdown +from dropbox_sign.models.template_response_document_static_field_hyperlink import TemplateResponseDocumentStaticFieldHyperlink +from dropbox_sign.models.template_response_document_static_field_initials import TemplateResponseDocumentStaticFieldInitials +from dropbox_sign.models.template_response_document_static_field_radio import TemplateResponseDocumentStaticFieldRadio +from dropbox_sign.models.template_response_document_static_field_signature import TemplateResponseDocumentStaticFieldSignature +from dropbox_sign.models.template_response_document_static_field_text import TemplateResponseDocumentStaticFieldText +from dropbox_sign.models.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength +from dropbox_sign.models.template_response_signer_role import TemplateResponseSignerRole +from dropbox_sign.models.template_update_files_request import TemplateUpdateFilesRequest +from dropbox_sign.models.template_update_files_response import TemplateUpdateFilesResponse +from dropbox_sign.models.template_update_files_response_template import TemplateUpdateFilesResponseTemplate +from dropbox_sign.models.unclaimed_draft_create_embedded_request import UnclaimedDraftCreateEmbeddedRequest +from dropbox_sign.models.unclaimed_draft_create_embedded_with_template_request import UnclaimedDraftCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.unclaimed_draft_create_request import UnclaimedDraftCreateRequest +from dropbox_sign.models.unclaimed_draft_create_response import UnclaimedDraftCreateResponse +from dropbox_sign.models.unclaimed_draft_edit_and_resend_request import UnclaimedDraftEditAndResendRequest +from dropbox_sign.models.unclaimed_draft_response import UnclaimedDraftResponse +from dropbox_sign.models.warning_response import WarningResponse from dropbox_sign.event_callback_helper import EventCallbackHelper diff --git a/dropbox_sign/api/__init__.py b/dropbox_sign/api/__init__.py index 5edf83a..05f2092 100644 --- a/dropbox_sign/api/__init__.py +++ b/dropbox_sign/api/__init__.py @@ -1,3 +1,15 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from dropbox_sign.apis import AccountApi +# flake8: noqa + +# import apis into api package +from dropbox_sign.api.account_api import AccountApi +from dropbox_sign.api.api_app_api import ApiAppApi +from dropbox_sign.api.bulk_send_job_api import BulkSendJobApi +from dropbox_sign.api.embedded_api import EmbeddedApi +from dropbox_sign.api.fax_line_api import FaxLineApi +from dropbox_sign.api.o_auth_api import OAuthApi +from dropbox_sign.api.report_api import ReportApi +from dropbox_sign.api.signature_request_api import SignatureRequestApi +from dropbox_sign.api.team_api import TeamApi +from dropbox_sign.api.template_api import TemplateApi +from dropbox_sign.api.unclaimed_draft_api import UnclaimedDraftApi + diff --git a/dropbox_sign/api/account_api.py b/dropbox_sign/api/account_api.py index 5ca7fdd..f4cb4dc 100644 --- a/dropbox_sign/api/account_api.py +++ b/dropbox_sign/api/account_api.py @@ -1,657 +1,1222 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from dropbox_sign.models.account_create_request import AccountCreateRequest +from dropbox_sign.models.account_create_response import AccountCreateResponse +from dropbox_sign.models.account_get_response import AccountGetResponse +from dropbox_sign.models.account_update_request import AccountUpdateRequest +from dropbox_sign.models.account_verify_request import AccountVerifyRequest +from dropbox_sign.models.account_verify_response import AccountVerifyResponse + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.account_create_request import AccountCreateRequest -from dropbox_sign.model.account_create_response import AccountCreateResponse -from dropbox_sign.model.account_get_response import AccountGetResponse -from dropbox_sign.model.account_update_request import AccountUpdateRequest -from dropbox_sign.model.account_verify_request import AccountVerifyRequest -from dropbox_sign.model.account_verify_response import AccountVerifyResponse -from dropbox_sign.model.error_response import ErrorResponse - - -class AccountApi(object): +class AccountApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.account_create_endpoint = _Endpoint( - settings={ - 'response_type': (AccountCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/account/create', - 'operation_id': 'account_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_create_request', - ], - 'required': [ - 'account_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_create_request': - (AccountCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'account_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.account_get_endpoint = _Endpoint( - settings={ - 'response_type': (AccountGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/account', - 'operation_id': 'account_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_id', - 'email_address', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'email_address': - (str,), - }, - 'attribute_map': { - 'account_id': 'account_id', - 'email_address': 'email_address', - }, - 'location_map': { - 'account_id': 'query', - 'email_address': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.account_update_endpoint = _Endpoint( - settings={ - 'response_type': (AccountGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/account', - 'operation_id': 'account_update', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_update_request', - ], - 'required': [ - 'account_update_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_update_request': - (AccountUpdateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'account_update_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.account_verify_endpoint = _Endpoint( - settings={ - 'response_type': (AccountVerifyResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/account/verify', - 'operation_id': 'account_verify', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_verify_request', - ], - 'required': [ - 'account_verify_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_verify_request': - (AccountVerifyRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'account_verify_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def account_create( self, - account_create_request, - **kwargs + account_create_request: AccountCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AccountCreateResponse: - """Create Account # noqa: E501 - - Creates a new Dropbox Sign Account that is associated with the specified `email_address`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.account_create(account_create_request, async_req=True) - >>> result = thread.get() - - Args: - account_create_request (AccountCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AccountCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['account_create_request'] = \ - account_create_request - try: - return self.account_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[AccountCreateResponse], - _check_type=True, - ) + """Create Account + + Creates a new Dropbox Sign Account that is associated with the specified `email_address`. + + :param account_create_request: (required) + :type account_create_request: AccountCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_create_serialize( + account_create_request=account_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def account_create_with_http_info( + self, + account_create_request: AccountCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AccountCreateResponse]: + """Create Account + + Creates a new Dropbox Sign Account that is associated with the specified `email_address`. + + :param account_create_request: (required) + :type account_create_request: AccountCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_create_serialize( + account_create_request=account_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def account_create_without_preload_content( + self, + account_create_request: AccountCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Account + + Creates a new Dropbox Sign Account that is associated with the specified `email_address`. + + :param account_create_request: (required) + :type account_create_request: AccountCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_create_serialize( + account_create_request=account_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + def _account_create_serialize( + self, + account_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = account_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if account_create_request is not None and has_files is False: + _body_params = account_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/account/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e + + + @validate_call def account_get( self, - **kwargs + account_id: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account.")] = None, + email_address: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AccountGetResponse: - """Get Account # noqa: E501 - - Returns the properties and settings of your Account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.account_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - account_id (str): `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account.. [optional] - email_address (str): `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AccountGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.account_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[AccountGetResponse], - _check_type=True, - ) + """Get Account - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + Returns the properties and settings of your Account. - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + :param account_id: `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. + :type account_id: str + :param email_address: `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. + :type email_address: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_get_serialize( + account_id=account_id, + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def account_get_with_http_info( + self, + account_id: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account.")] = None, + email_address: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AccountGetResponse]: + """Get Account + + Returns the properties and settings of your Account. + + :param account_id: `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. + :type account_id: str + :param email_address: `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. + :type email_address: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_get_serialize( + account_id=account_id, + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def account_get_without_preload_content( + self, + account_id: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account.")] = None, + email_address: Annotated[Optional[StrictStr], Field(description="`account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Account + + Returns the properties and settings of your Account. + + :param account_id: `account_id` or `email_address` is required. If both are provided, the account id prevails. The ID of the Account. + :type account_id: str + :param email_address: `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. + :type email_address: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_get_serialize( + account_id=account_id, + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _account_get_serialize( + self, + account_id, + email_address, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if account_id is not None: + + _query_params.append(('account_id', account_id)) + + if email_address is not None: + + _query_params.append(('email_address', email_address)) + + # process the header parameters + # process the form parameters + # process the body parameter - raise e + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/account', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def account_update( self, - account_update_request, - **kwargs + account_update_request: AccountUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AccountGetResponse: - """Update Account # noqa: E501 - - Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.account_update(account_update_request, async_req=True) - >>> result = thread.get() - - Args: - account_update_request (AccountUpdateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AccountGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['account_update_request'] = \ - account_update_request - try: - return self.account_update_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[AccountGetResponse], - _check_type=True, - ) + """Update Account + + Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + :param account_update_request: (required) + :type account_update_request: AccountUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_update_serialize( + account_update_request=account_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def account_update_with_http_info( + self, + account_update_request: AccountUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AccountGetResponse]: + """Update Account + + Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. + + :param account_update_request: (required) + :type account_update_request: AccountUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_update_serialize( + account_update_request=account_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def account_update_without_preload_content( + self, + account_update_request: AccountUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Account + + Updates the properties and settings of your Account. Currently only allows for updates to the [Callback URL](/api/reference/tag/Callbacks-and-Events) and locale. + + :param account_update_request: (required) + :type account_update_request: AccountUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_update_serialize( + account_update_request=account_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _account_update_serialize( + self, + account_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = account_update_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if account_update_request is not None and has_files is False: + _body_params = account_update_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/account', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e + + + @validate_call def account_verify( self, - account_verify_request, - **kwargs + account_verify_request: AccountVerifyRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AccountVerifyResponse: - """Verify Account # noqa: E501 - - Verifies whether an Dropbox Sign Account exists for the given email address. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.account_verify(account_verify_request, async_req=True) - >>> result = thread.get() - - Args: - account_verify_request (AccountVerifyRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AccountVerifyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['account_verify_request'] = \ - account_verify_request - try: - return self.account_verify_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[AccountVerifyResponse], - _check_type=True, - ) + """Verify Account + + Verifies whether an Dropbox Sign Account exists for the given email address. + + :param account_verify_request: (required) + :type account_verify_request: AccountVerifyRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_verify_serialize( + account_verify_request=account_verify_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountVerifyResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def account_verify_with_http_info( + self, + account_verify_request: AccountVerifyRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AccountVerifyResponse]: + """Verify Account - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + Verifies whether an Dropbox Sign Account exists for the given email address. + + :param account_verify_request: (required) + :type account_verify_request: AccountVerifyRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_verify_serialize( + account_verify_request=account_verify_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountVerifyResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def account_verify_without_preload_content( + self, + account_verify_request: AccountVerifyRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Verify Account - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + Verifies whether an Dropbox Sign Account exists for the given email address. + + :param account_verify_request: (required) + :type account_verify_request: AccountVerifyRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_verify_serialize( + account_verify_request=account_verify_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccountVerifyResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _account_verify_serialize( + self, + account_verify_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = account_verify_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if account_verify_request is not None and has_files is False: + _body_params = account_verify_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/account/verify', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/dropbox_sign/api/api_app_api.py b/dropbox_sign/api/api_app_api.py index c575780..ab502c5 100644 --- a/dropbox_sign/api/api_app_api.py +++ b/dropbox_sign/api/api_app_api.py @@ -1,796 +1,1465 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.api_app_create_request import ApiAppCreateRequest -from dropbox_sign.model.api_app_get_response import ApiAppGetResponse -from dropbox_sign.model.api_app_list_response import ApiAppListResponse -from dropbox_sign.model.api_app_update_request import ApiAppUpdateRequest -from dropbox_sign.model.error_response import ErrorResponse - - -class ApiAppApi(object): +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from dropbox_sign.models.api_app_create_request import ApiAppCreateRequest +from dropbox_sign.models.api_app_get_response import ApiAppGetResponse +from dropbox_sign.models.api_app_list_response import ApiAppListResponse +from dropbox_sign.models.api_app_update_request import ApiAppUpdateRequest + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class ApiAppApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.api_app_create_endpoint = _Endpoint( - settings={ - 'response_type': (ApiAppGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/api_app', - 'operation_id': 'api_app_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'api_app_create_request', - ], - 'required': [ - 'api_app_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'api_app_create_request': - (ApiAppCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'api_app_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.api_app_delete_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/api_app/{client_id}', - 'operation_id': 'api_app_delete', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'client_id', - ], - 'required': [ - 'client_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client_id': - (str,), - }, - 'attribute_map': { - 'client_id': 'client_id', - }, - 'location_map': { - 'client_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.api_app_get_endpoint = _Endpoint( - settings={ - 'response_type': (ApiAppGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/api_app/{client_id}', - 'operation_id': 'api_app_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'client_id', - ], - 'required': [ - 'client_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client_id': - (str,), - }, - 'attribute_map': { - 'client_id': 'client_id', - }, - 'location_map': { - 'client_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.api_app_list_endpoint = _Endpoint( - settings={ - 'response_type': (ApiAppListResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/api_app/list', - 'operation_id': 'api_app_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'page', - 'page_size', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'page': - (int,), - 'page_size': - (int,), - }, - 'attribute_map': { - 'page': 'page', - 'page_size': 'page_size', - }, - 'location_map': { - 'page': 'query', - 'page_size': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.api_app_update_endpoint = _Endpoint( - settings={ - 'response_type': (ApiAppGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/api_app/{client_id}', - 'operation_id': 'api_app_update', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'client_id', - 'api_app_update_request', - ], - 'required': [ - 'client_id', - 'api_app_update_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client_id': - (str,), - 'api_app_update_request': - (ApiAppUpdateRequest,), - }, - 'attribute_map': { - 'client_id': 'client_id', - }, - 'location_map': { - 'client_id': 'path', - 'api_app_update_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) + + @validate_call def api_app_create( self, - api_app_create_request, - **kwargs + api_app_create_request: ApiAppCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiAppGetResponse: - """Create API App # noqa: E501 - - Creates a new API App. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.api_app_create(api_app_create_request, async_req=True) - >>> result = thread.get() - - Args: - api_app_create_request (ApiAppCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiAppGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['api_app_create_request'] = \ - api_app_create_request - try: - return self.api_app_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 201: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ApiAppGetResponse], - _check_type=True, - ) + """Create API App + + Creates a new API App. + + :param api_app_create_request: (required) + :type api_app_create_request: ApiAppCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_create_serialize( + api_app_create_request=api_app_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def api_app_create_with_http_info( + self, + api_app_create_request: ApiAppCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiAppGetResponse]: + """Create API App + + Creates a new API App. + + :param api_app_create_request: (required) + :type api_app_create_request: ApiAppCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_create_serialize( + api_app_create_request=api_app_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def api_app_create_without_preload_content( + self, + api_app_create_request: ApiAppCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create API App + + Creates a new API App. + + :param api_app_create_request: (required) + :type api_app_create_request: ApiAppCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_create_serialize( + api_app_create_request=api_app_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _api_app_create_serialize( + self, + api_app_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = api_app_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if api_app_create_request is not None and has_files is False: + _body_params = api_app_create_request + - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api_app', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def api_app_delete( self, - client_id, - **kwargs + client_id: Annotated[StrictStr, Field(description="The client id of the API App to delete.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete API App # noqa: E501 - - Deletes an API App. Can only be invoked for apps you own. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.api_app_delete(client_id, async_req=True) - >>> result = thread.get() - - Args: - client_id (str): The client id of the API App to delete. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_id'] = \ - client_id - return self.api_app_delete_endpoint.call_with_http_info(**kwargs) + """Delete API App - def api_app_get( + Deletes an API App. Can only be invoked for apps you own. + + :param client_id: The client id of the API App to delete. (required) + :type client_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_delete_serialize( + client_id=client_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def api_app_delete_with_http_info( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to delete.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete API App + + Deletes an API App. Can only be invoked for apps you own. + + :param client_id: The client id of the API App to delete. (required) + :type client_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_delete_serialize( + client_id=client_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def api_app_delete_without_preload_content( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to delete.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete API App + + Deletes an API App. Can only be invoked for apps you own. + + :param client_id: The client id of the API App to delete. (required) + :type client_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_delete_serialize( + client_id=client_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _api_app_delete_serialize( self, client_id, - **kwargs + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if client_id is not None: + _path_params['client_id'] = client_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api_app/{client_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def api_app_get( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiAppGetResponse: - """Get API App # noqa: E501 - - Returns an object with information about an API App. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.api_app_get(client_id, async_req=True) - >>> result = thread.get() - - Args: - client_id (str): The client id of the API App to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiAppGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_id'] = \ - client_id - try: - return self.api_app_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ApiAppGetResponse], - _check_type=True, - ) + """Get API App - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + Returns an object with information about an API App. - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + :param client_id: The client id of the API App to retrieve. (required) + :type client_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_get_serialize( + client_id=client_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def api_app_get_with_http_info( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiAppGetResponse]: + """Get API App + + Returns an object with information about an API App. + + :param client_id: The client id of the API App to retrieve. (required) + :type client_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_get_serialize( + client_id=client_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - raise e + @validate_call + def api_app_get_without_preload_content( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get API App + + Returns an object with information about an API App. + + :param client_id: The client id of the API App to retrieve. (required) + :type client_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_get_serialize( + client_id=client_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _api_app_get_serialize( + self, + client_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if client_id is not None: + _path_params['client_id'] = client_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api_app/{client_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def api_app_list( self, - **kwargs + page: Annotated[Optional[StrictInt], Field(description="Which page number of the API App List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiAppListResponse: - """List API Apps # noqa: E501 - - Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.api_app_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - page (int): Which page number of the API App List to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.. [optional] if omitted the server will use the default value of 20 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiAppListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.api_app_list_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ApiAppListResponse], - _check_type=True, - ) + """List API Apps + + Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. + + :param page: Which page number of the API App List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def api_app_list_with_http_info( + self, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the API App List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiAppListResponse]: + """List API Apps + + Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. + + :param page: Which page number of the API App List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def api_app_list_without_preload_content( + self, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the API App List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List API Apps + + Returns a list of API Apps that are accessible by you. If you are on a team with an Admin or Developer role, this list will include apps owned by teammates. + + :param page: Which page number of the API App List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _api_app_list_serialize( + self, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api_app/list', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def api_app_update( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to update.")], + api_app_update_request: ApiAppUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiAppGetResponse: + """Update API App + + Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. + + :param client_id: The client id of the API App to update. (required) + :type client_id: str + :param api_app_update_request: (required) + :type api_app_update_request: ApiAppUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_update_serialize( + client_id=client_id, + api_app_update_request=api_app_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def api_app_update_with_http_info( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to update.")], + api_app_update_request: ApiAppUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiAppGetResponse]: + """Update API App + + Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. + + :param client_id: The client id of the API App to update. (required) + :type client_id: str + :param api_app_update_request: (required) + :type api_app_update_request: ApiAppUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_update_serialize( + client_id=client_id, + api_app_update_request=api_app_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def api_app_update_without_preload_content( + self, + client_id: Annotated[StrictStr, Field(description="The client id of the API App to update.")], + api_app_update_request: ApiAppUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update API App + + Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. + + :param client_id: The client id of the API App to update. (required) + :type client_id: str + :param api_app_update_request: (required) + :type api_app_update_request: ApiAppUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._api_app_update_serialize( + client_id=client_id, + api_app_update_request=api_app_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAppGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _api_app_update_serialize( self, client_id, api_app_update_request, - **kwargs - ) -> ApiAppGetResponse: - """Update API App # noqa: E501 - - Updates an existing API App. Can only be invoked for apps you own. Only the fields you provide will be updated. If you wish to clear an existing optional field, provide an empty string. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.api_app_update(client_id, api_app_update_request, async_req=True) - >>> result = thread.get() - - Args: - client_id (str): The client id of the API App to update. - api_app_update_request (ApiAppUpdateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ApiAppGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_id'] = \ - client_id - kwargs['api_app_update_request'] = \ - api_app_update_request - try: - return self.api_app_update_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ApiAppGetResponse], - _check_type=True, - ) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = api_app_update_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # process the path parameters + if client_id is not None: + _path_params['client_id'] = client_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if api_app_update_request is not None and has_files is False: + _body_params = api_app_update_request - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/api_app/{client_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/dropbox_sign/api/bulk_send_job_api.py b/dropbox_sign/api/bulk_send_job_api.py index 93e39e1..8bb2a43 100644 --- a/dropbox_sign/api/bulk_send_job_api.py +++ b/dropbox_sign/api/bulk_send_job_api.py @@ -1,358 +1,621 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from dropbox_sign.models.bulk_send_job_get_response import BulkSendJobGetResponse +from dropbox_sign.models.bulk_send_job_list_response import BulkSendJobListResponse -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.bulk_send_job_get_response import BulkSendJobGetResponse -from dropbox_sign.model.bulk_send_job_list_response import BulkSendJobListResponse -from dropbox_sign.model.error_response import ErrorResponse +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -class BulkSendJobApi(object): +class BulkSendJobApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.bulk_send_job_get_endpoint = _Endpoint( - settings={ - 'response_type': (BulkSendJobGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/bulk_send_job/{bulk_send_job_id}', - 'operation_id': 'bulk_send_job_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'bulk_send_job_id', - 'page', - 'page_size', - ], - 'required': [ - 'bulk_send_job_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'bulk_send_job_id': - (str,), - 'page': - (int,), - 'page_size': - (int,), - }, - 'attribute_map': { - 'bulk_send_job_id': 'bulk_send_job_id', - 'page': 'page', - 'page_size': 'page_size', - }, - 'location_map': { - 'bulk_send_job_id': 'path', - 'page': 'query', - 'page_size': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.bulk_send_job_list_endpoint = _Endpoint( - settings={ - 'response_type': (BulkSendJobListResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/bulk_send_job/list', - 'operation_id': 'bulk_send_job_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'page', - 'page_size', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'page': - (int,), - 'page_size': - (int,), - }, - 'attribute_map': { - 'page': 'page', - 'page_size': 'page_size', - }, - 'location_map': { - 'page': 'query', - 'page_size': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def bulk_send_job_get( self, - bulk_send_job_id, - **kwargs + bulk_send_job_id: Annotated[StrictStr, Field(description="The id of the BulkSendJob to retrieve.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BulkSendJobGetResponse: - """Get Bulk Send Job # noqa: E501 - - Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.bulk_send_job_get(bulk_send_job_id, async_req=True) - >>> result = thread.get() - - Args: - bulk_send_job_id (str): The id of the BulkSendJob to retrieve. - - Keyword Args: - page (int): Which page number of the BulkSendJob list to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.. [optional] if omitted the server will use the default value of 20 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - BulkSendJobGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """Get Bulk Send Job + + Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. + + :param bulk_send_job_id: The id of the BulkSendJob to retrieve. (required) + :type bulk_send_job_id: str + :param page: Which page number of the BulkSendJob list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bulk_send_job_get_serialize( + bulk_send_job_id=bulk_send_job_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def bulk_send_job_get_with_http_info( + self, + bulk_send_job_id: Annotated[StrictStr, Field(description="The id of the BulkSendJob to retrieve.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BulkSendJobGetResponse]: + """Get Bulk Send Job + + Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. + + :param bulk_send_job_id: The id of the BulkSendJob to retrieve. (required) + :type bulk_send_job_id: str + :param page: Which page number of the BulkSendJob list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bulk_send_job_get_serialize( + bulk_send_job_id=bulk_send_job_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def bulk_send_job_get_without_preload_content( + self, + bulk_send_job_id: Annotated[StrictStr, Field(description="The id of the BulkSendJob to retrieve.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Bulk Send Job + + Returns the status of the BulkSendJob and its SignatureRequests specified by the `bulk_send_job_id` parameter. + + :param bulk_send_job_id: The id of the BulkSendJob to retrieve. (required) + :type bulk_send_job_id: str + :param page: Which page number of the BulkSendJob list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bulk_send_job_get_serialize( + bulk_send_job_id=bulk_send_job_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['bulk_send_job_id'] = \ - bulk_send_job_id - try: - return self.bulk_send_job_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[BulkSendJobGetResponse], - _check_type=True, - ) - - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - - raise e + return response_data.response + + + def _bulk_send_job_get_serialize( + self, + bulk_send_job_id, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bulk_send_job_id is not None: + _path_params['bulk_send_job_id'] = bulk_send_job_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/bulk_send_job/{bulk_send_job_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def bulk_send_job_list( self, - **kwargs + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BulkSendJobListResponse: - """List Bulk Send Jobs # noqa: E501 - - Returns a list of BulkSendJob that you can access. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.bulk_send_job_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - page (int): Which page number of the BulkSendJob List to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.. [optional] if omitted the server will use the default value of 20 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - BulkSendJobListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """List Bulk Send Jobs + + Returns a list of BulkSendJob that you can access. + + :param page: Which page number of the BulkSendJob List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bulk_send_job_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def bulk_send_job_list_with_http_info( + self, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BulkSendJobListResponse]: + """List Bulk Send Jobs + + Returns a list of BulkSendJob that you can access. + + :param page: Which page number of the BulkSendJob List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bulk_send_job_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def bulk_send_job_list_without_preload_content( + self, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the BulkSendJob List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is 20.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Bulk Send Jobs + + Returns a list of BulkSendJob that you can access. + + :param page: Which page number of the BulkSendJob List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bulk_send_job_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + return response_data.response + + + def _bulk_send_job_list_serialize( + self, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/bulk_send_job/list', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.bulk_send_job_list_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[BulkSendJobListResponse], - _check_type=True, - ) - - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - - raise e + diff --git a/dropbox_sign/api/embedded_api.py b/dropbox_sign/api/embedded_api.py index 78d374f..8d9f623 100644 --- a/dropbox_sign/api/embedded_api.py +++ b/dropbox_sign/api/embedded_api.py @@ -1,358 +1,618 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from dropbox_sign.models.embedded_edit_url_request import EmbeddedEditUrlRequest +from dropbox_sign.models.embedded_edit_url_response import EmbeddedEditUrlResponse +from dropbox_sign.models.embedded_sign_url_response import EmbeddedSignUrlResponse -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.embedded_edit_url_request import EmbeddedEditUrlRequest -from dropbox_sign.model.embedded_edit_url_response import EmbeddedEditUrlResponse -from dropbox_sign.model.embedded_sign_url_response import EmbeddedSignUrlResponse -from dropbox_sign.model.error_response import ErrorResponse +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -class EmbeddedApi(object): +class EmbeddedApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.embedded_edit_url_endpoint = _Endpoint( - settings={ - 'response_type': (EmbeddedEditUrlResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/embedded/edit_url/{template_id}', - 'operation_id': 'embedded_edit_url', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'embedded_edit_url_request', - ], - 'required': [ - 'template_id', - 'embedded_edit_url_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - 'embedded_edit_url_request': - (EmbeddedEditUrlRequest,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - 'embedded_edit_url_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.embedded_sign_url_endpoint = _Endpoint( - settings={ - 'response_type': (EmbeddedSignUrlResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/embedded/sign_url/{signature_id}', - 'operation_id': 'embedded_sign_url', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_id', - ], - 'required': [ - 'signature_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_id': - (str,), - }, - 'attribute_map': { - 'signature_id': 'signature_id', - }, - 'location_map': { - 'signature_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def embedded_edit_url( self, - template_id, - embedded_edit_url_request, - **kwargs + template_id: Annotated[StrictStr, Field(description="The id of the template to edit.")], + embedded_edit_url_request: EmbeddedEditUrlRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> EmbeddedEditUrlResponse: - """Get Embedded Template Edit URL # noqa: E501 - - Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.embedded_edit_url(template_id, embedded_edit_url_request, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the template to edit. - embedded_edit_url_request (EmbeddedEditUrlRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - EmbeddedEditUrlResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """Get Embedded Template Edit URL + + Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. + + :param template_id: The id of the template to edit. (required) + :type template_id: str + :param embedded_edit_url_request: (required) + :type embedded_edit_url_request: EmbeddedEditUrlRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._embedded_edit_url_serialize( + template_id=template_id, + embedded_edit_url_request=embedded_edit_url_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedEditUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def embedded_edit_url_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template to edit.")], + embedded_edit_url_request: EmbeddedEditUrlRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EmbeddedEditUrlResponse]: + """Get Embedded Template Edit URL + + Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. + + :param template_id: The id of the template to edit. (required) + :type template_id: str + :param embedded_edit_url_request: (required) + :type embedded_edit_url_request: EmbeddedEditUrlRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._embedded_edit_url_serialize( + template_id=template_id, + embedded_edit_url_request=embedded_edit_url_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedEditUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def embedded_edit_url_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template to edit.")], + embedded_edit_url_request: EmbeddedEditUrlRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Embedded Template Edit URL + + Retrieves an embedded object containing a template url that can be opened in an iFrame. Note that only templates created via the embedded template process are available to be edited with this endpoint. + + :param template_id: The id of the template to edit. (required) + :type template_id: str + :param embedded_edit_url_request: (required) + :type embedded_edit_url_request: EmbeddedEditUrlRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._embedded_edit_url_serialize( + template_id=template_id, + embedded_edit_url_request=embedded_edit_url_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedEditUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - kwargs['embedded_edit_url_request'] = \ - embedded_edit_url_request - try: - return self.embedded_edit_url_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[EmbeddedEditUrlResponse], - _check_type=True, - ) + return response_data.response + + + def _embedded_edit_url_serialize( + self, + template_id, + embedded_edit_url_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = embedded_edit_url_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if embedded_edit_url_request is not None and has_files is False: + _body_params = embedded_edit_url_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/embedded/edit_url/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def embedded_sign_url( self, - signature_id, - **kwargs + signature_id: Annotated[StrictStr, Field(description="The id of the signature to get a signature url for.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> EmbeddedSignUrlResponse: - """Get Embedded Sign URL # noqa: E501 - - Retrieves an embedded object containing a signature url that can be opened in an iFrame. Note that templates created via the embedded template process will only be accessible through the API. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.embedded_sign_url(signature_id, async_req=True) - >>> result = thread.get() - - Args: - signature_id (str): The id of the signature to get a signature url for. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - EmbeddedSignUrlResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """Get Embedded Sign URL + + Retrieves an embedded object containing a signature url that can be opened in an iFrame. Note that templates created via the embedded template process will only be accessible through the API. + + :param signature_id: The id of the signature to get a signature url for. (required) + :type signature_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._embedded_sign_url_serialize( + signature_id=signature_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedSignUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def embedded_sign_url_with_http_info( + self, + signature_id: Annotated[StrictStr, Field(description="The id of the signature to get a signature url for.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EmbeddedSignUrlResponse]: + """Get Embedded Sign URL + + Retrieves an embedded object containing a signature url that can be opened in an iFrame. Note that templates created via the embedded template process will only be accessible through the API. + + :param signature_id: The id of the signature to get a signature url for. (required) + :type signature_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._embedded_sign_url_serialize( + signature_id=signature_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedSignUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def embedded_sign_url_without_preload_content( + self, + signature_id: Annotated[StrictStr, Field(description="The id of the signature to get a signature url for.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Embedded Sign URL + + Retrieves an embedded object containing a signature url that can be opened in an iFrame. Note that templates created via the embedded template process will only be accessible through the API. + + :param signature_id: The id of the signature to get a signature url for. (required) + :type signature_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._embedded_sign_url_serialize( + signature_id=signature_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EmbeddedSignUrlResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_id'] = \ - signature_id - try: - return self.embedded_sign_url_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[EmbeddedSignUrlResponse], - _check_type=True, - ) + return response_data.response - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + def _embedded_sign_url_serialize( + self, + signature_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if signature_id is not None: + _path_params['signature_id'] = signature_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/embedded/sign_url/{signature_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/dropbox_sign/api/fax_line_api.py b/dropbox_sign/api/fax_line_api.py new file mode 100644 index 0000000..5d9aa88 --- /dev/null +++ b/dropbox_sign/api/fax_line_api.py @@ -0,0 +1,2129 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from dropbox_sign.models.fax_line_add_user_request import FaxLineAddUserRequest +from dropbox_sign.models.fax_line_area_code_get_response import FaxLineAreaCodeGetResponse +from dropbox_sign.models.fax_line_create_request import FaxLineCreateRequest +from dropbox_sign.models.fax_line_delete_request import FaxLineDeleteRequest +from dropbox_sign.models.fax_line_list_response import FaxLineListResponse +from dropbox_sign.models.fax_line_remove_user_request import FaxLineRemoveUserRequest +from dropbox_sign.models.fax_line_response import FaxLineResponse + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class FaxLineApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def fax_line_add_user( + self, + fax_line_add_user_request: FaxLineAddUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FaxLineResponse: + """Add Fax Line User + + Grants a user access to the specified Fax Line. + + :param fax_line_add_user_request: (required) + :type fax_line_add_user_request: FaxLineAddUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_add_user_serialize( + fax_line_add_user_request=fax_line_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def fax_line_add_user_with_http_info( + self, + fax_line_add_user_request: FaxLineAddUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FaxLineResponse]: + """Add Fax Line User + + Grants a user access to the specified Fax Line. + + :param fax_line_add_user_request: (required) + :type fax_line_add_user_request: FaxLineAddUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_add_user_serialize( + fax_line_add_user_request=fax_line_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def fax_line_add_user_without_preload_content( + self, + fax_line_add_user_request: FaxLineAddUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add Fax Line User + + Grants a user access to the specified Fax Line. + + :param fax_line_add_user_request: (required) + :type fax_line_add_user_request: FaxLineAddUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_add_user_serialize( + fax_line_add_user_request=fax_line_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_add_user_serialize( + self, + fax_line_add_user_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = fax_line_add_user_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if fax_line_add_user_request is not None and has_files is False: + _body_params = fax_line_add_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/fax_line/add_user', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def fax_line_area_code_get( + self, + country: Annotated[StrictStr, Field(description="Filter area codes by country.")], + state: Annotated[Optional[StrictStr], Field(description="Filter area codes by state.")] = None, + province: Annotated[Optional[StrictStr], Field(description="Filter area codes by province.")] = None, + city: Annotated[Optional[StrictStr], Field(description="Filter area codes by city.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FaxLineAreaCodeGetResponse: + """Get Available Fax Line Area Codes + + Returns a response with the area codes available for a given state/provice and city. + + :param country: Filter area codes by country. (required) + :type country: str + :param state: Filter area codes by state. + :type state: str + :param province: Filter area codes by province. + :type province: str + :param city: Filter area codes by city. + :type city: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_area_code_get_serialize( + country=country, + state=state, + province=province, + city=city, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineAreaCodeGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def fax_line_area_code_get_with_http_info( + self, + country: Annotated[StrictStr, Field(description="Filter area codes by country.")], + state: Annotated[Optional[StrictStr], Field(description="Filter area codes by state.")] = None, + province: Annotated[Optional[StrictStr], Field(description="Filter area codes by province.")] = None, + city: Annotated[Optional[StrictStr], Field(description="Filter area codes by city.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FaxLineAreaCodeGetResponse]: + """Get Available Fax Line Area Codes + + Returns a response with the area codes available for a given state/provice and city. + + :param country: Filter area codes by country. (required) + :type country: str + :param state: Filter area codes by state. + :type state: str + :param province: Filter area codes by province. + :type province: str + :param city: Filter area codes by city. + :type city: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_area_code_get_serialize( + country=country, + state=state, + province=province, + city=city, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineAreaCodeGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def fax_line_area_code_get_without_preload_content( + self, + country: Annotated[StrictStr, Field(description="Filter area codes by country.")], + state: Annotated[Optional[StrictStr], Field(description="Filter area codes by state.")] = None, + province: Annotated[Optional[StrictStr], Field(description="Filter area codes by province.")] = None, + city: Annotated[Optional[StrictStr], Field(description="Filter area codes by city.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Available Fax Line Area Codes + + Returns a response with the area codes available for a given state/provice and city. + + :param country: Filter area codes by country. (required) + :type country: str + :param state: Filter area codes by state. + :type state: str + :param province: Filter area codes by province. + :type province: str + :param city: Filter area codes by city. + :type city: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_area_code_get_serialize( + country=country, + state=state, + province=province, + city=city, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineAreaCodeGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_area_code_get_serialize( + self, + country, + state, + province, + city, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if country is not None: + + _query_params.append(('country', country)) + + if state is not None: + + _query_params.append(('state', state)) + + if province is not None: + + _query_params.append(('province', province)) + + if city is not None: + + _query_params.append(('city', city)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fax_line/area_codes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def fax_line_create( + self, + fax_line_create_request: FaxLineCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FaxLineResponse: + """Purchase Fax Line + + Purchases a new Fax Line. + + :param fax_line_create_request: (required) + :type fax_line_create_request: FaxLineCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_create_serialize( + fax_line_create_request=fax_line_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def fax_line_create_with_http_info( + self, + fax_line_create_request: FaxLineCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FaxLineResponse]: + """Purchase Fax Line + + Purchases a new Fax Line. + + :param fax_line_create_request: (required) + :type fax_line_create_request: FaxLineCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_create_serialize( + fax_line_create_request=fax_line_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def fax_line_create_without_preload_content( + self, + fax_line_create_request: FaxLineCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Purchase Fax Line + + Purchases a new Fax Line. + + :param fax_line_create_request: (required) + :type fax_line_create_request: FaxLineCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_create_serialize( + fax_line_create_request=fax_line_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_create_serialize( + self, + fax_line_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = fax_line_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if fax_line_create_request is not None and has_files is False: + _body_params = fax_line_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/fax_line/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def fax_line_delete( + self, + fax_line_delete_request: FaxLineDeleteRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Fax Line + + Deletes the specified Fax Line from the subscription. + + :param fax_line_delete_request: (required) + :type fax_line_delete_request: FaxLineDeleteRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_delete_serialize( + fax_line_delete_request=fax_line_delete_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def fax_line_delete_with_http_info( + self, + fax_line_delete_request: FaxLineDeleteRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Fax Line + + Deletes the specified Fax Line from the subscription. + + :param fax_line_delete_request: (required) + :type fax_line_delete_request: FaxLineDeleteRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_delete_serialize( + fax_line_delete_request=fax_line_delete_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def fax_line_delete_without_preload_content( + self, + fax_line_delete_request: FaxLineDeleteRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Fax Line + + Deletes the specified Fax Line from the subscription. + + :param fax_line_delete_request: (required) + :type fax_line_delete_request: FaxLineDeleteRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_delete_serialize( + fax_line_delete_request=fax_line_delete_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_delete_serialize( + self, + fax_line_delete_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = fax_line_delete_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if fax_line_delete_request is not None and has_files is False: + _body_params = fax_line_delete_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/fax_line', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def fax_line_get( + self, + number: Annotated[StrictStr, Field(description="The Fax Line number.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FaxLineResponse: + """Get Fax Line + + Returns the properties and settings of a Fax Line. + + :param number: The Fax Line number. (required) + :type number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_get_serialize( + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def fax_line_get_with_http_info( + self, + number: Annotated[StrictStr, Field(description="The Fax Line number.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FaxLineResponse]: + """Get Fax Line + + Returns the properties and settings of a Fax Line. + + :param number: The Fax Line number. (required) + :type number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_get_serialize( + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def fax_line_get_without_preload_content( + self, + number: Annotated[StrictStr, Field(description="The Fax Line number.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Fax Line + + Returns the properties and settings of a Fax Line. + + :param number: The Fax Line number. (required) + :type number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_get_serialize( + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_get_serialize( + self, + number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if number is not None: + + _query_params.append(('number', number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fax_line', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def fax_line_list( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Account ID")] = None, + page: Annotated[Optional[StrictInt], Field(description="Page")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Page size")] = None, + show_team_lines: Annotated[Optional[StrictBool], Field(description="Show team lines")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FaxLineListResponse: + """List Fax Lines + + Returns the properties and settings of multiple Fax Lines. + + :param account_id: Account ID + :type account_id: str + :param page: Page + :type page: int + :param page_size: Page size + :type page_size: int + :param show_team_lines: Show team lines + :type show_team_lines: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + show_team_lines=show_team_lines, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def fax_line_list_with_http_info( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Account ID")] = None, + page: Annotated[Optional[StrictInt], Field(description="Page")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Page size")] = None, + show_team_lines: Annotated[Optional[StrictBool], Field(description="Show team lines")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FaxLineListResponse]: + """List Fax Lines + + Returns the properties and settings of multiple Fax Lines. + + :param account_id: Account ID + :type account_id: str + :param page: Page + :type page: int + :param page_size: Page size + :type page_size: int + :param show_team_lines: Show team lines + :type show_team_lines: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + show_team_lines=show_team_lines, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def fax_line_list_without_preload_content( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Account ID")] = None, + page: Annotated[Optional[StrictInt], Field(description="Page")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Page size")] = None, + show_team_lines: Annotated[Optional[StrictBool], Field(description="Show team lines")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Fax Lines + + Returns the properties and settings of multiple Fax Lines. + + :param account_id: Account ID + :type account_id: str + :param page: Page + :type page: int + :param page_size: Page size + :type page_size: int + :param show_team_lines: Show team lines + :type show_team_lines: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + show_team_lines=show_team_lines, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_list_serialize( + self, + account_id, + page, + page_size, + show_team_lines, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if account_id is not None: + + _query_params.append(('account_id', account_id)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if show_team_lines is not None: + + _query_params.append(('show_team_lines', show_team_lines)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/fax_line/list', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def fax_line_remove_user( + self, + fax_line_remove_user_request: FaxLineRemoveUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FaxLineResponse: + """Remove Fax Line Access + + Removes a user's access to the specified Fax Line. + + :param fax_line_remove_user_request: (required) + :type fax_line_remove_user_request: FaxLineRemoveUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_remove_user_serialize( + fax_line_remove_user_request=fax_line_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def fax_line_remove_user_with_http_info( + self, + fax_line_remove_user_request: FaxLineRemoveUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FaxLineResponse]: + """Remove Fax Line Access + + Removes a user's access to the specified Fax Line. + + :param fax_line_remove_user_request: (required) + :type fax_line_remove_user_request: FaxLineRemoveUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_remove_user_serialize( + fax_line_remove_user_request=fax_line_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def fax_line_remove_user_without_preload_content( + self, + fax_line_remove_user_request: FaxLineRemoveUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove Fax Line Access + + Removes a user's access to the specified Fax Line. + + :param fax_line_remove_user_request: (required) + :type fax_line_remove_user_request: FaxLineRemoveUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fax_line_remove_user_serialize( + fax_line_remove_user_request=fax_line_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FaxLineResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fax_line_remove_user_serialize( + self, + fax_line_remove_user_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = fax_line_remove_user_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if fax_line_remove_user_request is not None and has_files is False: + _body_params = fax_line_remove_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/fax_line/remove_user', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/dropbox_sign/api/o_auth_api.py b/dropbox_sign/api/o_auth_api.py index 8c85a5b..12165fc 100644 --- a/dropbox_sign/api/o_auth_api.py +++ b/dropbox_sign/api/o_auth_api.py @@ -1,328 +1,632 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 +from dropbox_sign.models.o_auth_token_generate_request import OAuthTokenGenerateRequest +from dropbox_sign.models.o_auth_token_refresh_request import OAuthTokenRefreshRequest +from dropbox_sign.models.o_auth_token_response import OAuthTokenResponse -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.o_auth_token_generate_request import OAuthTokenGenerateRequest -from dropbox_sign.model.o_auth_token_refresh_request import OAuthTokenRefreshRequest -from dropbox_sign.model.o_auth_token_response import OAuthTokenResponse +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -class OAuthApi(object): +class OAuthApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.oauth_token_generate_endpoint = _Endpoint( - settings={ - 'response_type': (OAuthTokenResponse,), - 'auth': [], - 'endpoint_path': '/oauth/token', - 'operation_id': 'oauth_token_generate', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://app.hellosign.com", - 'description': "No description provided", - }, - ] - }, - params_map={ - 'all': [ - 'o_auth_token_generate_request', - ], - 'required': [ - 'o_auth_token_generate_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'o_auth_token_generate_request': - (OAuthTokenGenerateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'o_auth_token_generate_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.oauth_token_refresh_endpoint = _Endpoint( - settings={ - 'response_type': (OAuthTokenResponse,), - 'auth': [], - 'endpoint_path': '/oauth/token?refresh', - 'operation_id': 'oauth_token_refresh', - 'http_method': 'POST', - 'servers': [ - { - 'url': "https://app.hellosign.com", - 'description': "No description provided", - }, - ] - }, - params_map={ - 'all': [ - 'o_auth_token_refresh_request', - ], - 'required': [ - 'o_auth_token_refresh_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'o_auth_token_refresh_request': - (OAuthTokenRefreshRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'o_auth_token_refresh_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def oauth_token_generate( self, - o_auth_token_generate_request, - **kwargs + o_auth_token_generate_request: OAuthTokenGenerateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, ) -> OAuthTokenResponse: - """OAuth Token Generate # noqa: E501 - - Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.oauth_token_generate(o_auth_token_generate_request, async_req=True) - >>> result = thread.get() - - Args: - o_auth_token_generate_request (OAuthTokenGenerateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - OAuthTokenResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """OAuth Token Generate + + Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. + + :param o_auth_token_generate_request: (required) + :type o_auth_token_generate_request: OAuthTokenGenerateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._oauth_token_generate_serialize( + o_auth_token_generate_request=o_auth_token_generate_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def oauth_token_generate_with_http_info( + self, + o_auth_token_generate_request: OAuthTokenGenerateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[OAuthTokenResponse]: + """OAuth Token Generate + + Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. + + :param o_auth_token_generate_request: (required) + :type o_auth_token_generate_request: OAuthTokenGenerateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._oauth_token_generate_serialize( + o_auth_token_generate_request=o_auth_token_generate_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def oauth_token_generate_without_preload_content( + self, + o_auth_token_generate_request: OAuthTokenGenerateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """OAuth Token Generate + + Once you have retrieved the code from the user callback, you will need to exchange it for an access token via a backend call. + + :param o_auth_token_generate_request: (required) + :type o_auth_token_generate_request: OAuthTokenGenerateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._oauth_token_generate_serialize( + o_auth_token_generate_request=o_auth_token_generate_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['o_auth_token_generate_request'] = \ - o_auth_token_generate_request - try: - return self.oauth_token_generate_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[OAuthTokenResponse], - _check_type=True, + return response_data.response + + + def _oauth_token_generate_serialize( + self, + o_auth_token_generate_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://app.hellosign.com' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = o_auth_token_generate_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if o_auth_token_generate_request is not None and has_files is False: + _body_params = o_auth_token_generate_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/oauth/token', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + - raise e + @validate_call def oauth_token_refresh( self, - o_auth_token_refresh_request, - **kwargs + o_auth_token_refresh_request: OAuthTokenRefreshRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, ) -> OAuthTokenResponse: - """OAuth Token Refresh # noqa: E501 - - Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.oauth_token_refresh(o_auth_token_refresh_request, async_req=True) - >>> result = thread.get() - - Args: - o_auth_token_refresh_request (OAuthTokenRefreshRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - OAuthTokenResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """OAuth Token Refresh + + Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. + + :param o_auth_token_refresh_request: (required) + :type o_auth_token_refresh_request: OAuthTokenRefreshRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._oauth_token_refresh_serialize( + o_auth_token_refresh_request=o_auth_token_refresh_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def oauth_token_refresh_with_http_info( + self, + o_auth_token_refresh_request: OAuthTokenRefreshRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[OAuthTokenResponse]: + """OAuth Token Refresh + + Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. + + :param o_auth_token_refresh_request: (required) + :type o_auth_token_refresh_request: OAuthTokenRefreshRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._oauth_token_refresh_serialize( + o_auth_token_refresh_request=o_auth_token_refresh_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def oauth_token_refresh_without_preload_content( + self, + o_auth_token_refresh_request: OAuthTokenRefreshRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """OAuth Token Refresh + + Access tokens are only valid for a given period of time (typically one hour) for security reasons. Whenever acquiring an new access token its TTL is also given (see `expires_in`), along with a refresh token that can be used to acquire a new access token after the current one has expired. + + :param o_auth_token_refresh_request: (required) + :type o_auth_token_refresh_request: OAuthTokenRefreshRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._oauth_token_refresh_serialize( + o_auth_token_refresh_request=o_auth_token_refresh_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OAuthTokenResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['o_auth_token_refresh_request'] = \ - o_auth_token_refresh_request - try: - return self.oauth_token_refresh_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[OAuthTokenResponse], - _check_type=True, + return response_data.response + + + def _oauth_token_refresh_serialize( + self, + o_auth_token_refresh_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://app.hellosign.com' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = o_auth_token_refresh_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if o_auth_token_refresh_request is not None and has_files is False: + _body_params = o_auth_token_refresh_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/oauth/token?refresh', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/dropbox_sign/api/report_api.py b/dropbox_sign/api/report_api.py index 7229530..8ce80c1 100644 --- a/dropbox_sign/api/report_api.py +++ b/dropbox_sign/api/report_api.py @@ -1,194 +1,336 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 +from dropbox_sign.models.report_create_request import ReportCreateRequest +from dropbox_sign.models.report_create_response import ReportCreateResponse -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.report_create_request import ReportCreateRequest -from dropbox_sign.model.report_create_response import ReportCreateResponse +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -class ReportApi(object): +class ReportApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.report_create_endpoint = _Endpoint( - settings={ - 'response_type': (ReportCreateResponse,), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/report/create', - 'operation_id': 'report_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'report_create_request', - ], - 'required': [ - 'report_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'report_create_request': - (ReportCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'report_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def report_create( self, - report_create_request, - **kwargs + report_create_request: ReportCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ReportCreateResponse: - """Create Report # noqa: E501 - - Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.report_create(report_create_request, async_req=True) - >>> result = thread.get() - - Args: - report_create_request (ReportCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ReportCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + """Create Report + + Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. + + :param report_create_request: (required) + :type report_create_request: ReportCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._report_create_serialize( + report_create_request=report_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReportCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def report_create_with_http_info( + self, + report_create_request: ReportCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ReportCreateResponse]: + """Create Report + + Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. + + :param report_create_request: (required) + :type report_create_request: ReportCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._report_create_serialize( + report_create_request=report_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReportCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def report_create_without_preload_content( + self, + report_create_request: ReportCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Report + + Request the creation of one or more report(s). When the report(s) have been generated, you will receive an email (one per requested report type) containing a link to download the report as a CSV file. The requested date range may be up to 12 months in duration, and `start_date` must not be more than 10 years in the past. + + :param report_create_request: (required) + :type report_create_request: ReportCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._report_create_serialize( + report_create_request=report_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReportCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['report_create_request'] = \ - report_create_request - try: - return self.report_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ReportCreateResponse], - _check_type=True, - ) + return response_data.response + + + def _report_create_serialize( + self, + report_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + has_files = False + body_param = report_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if report_create_request is not None and has_files is False: + _body_params = report_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/report/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/dropbox_sign/api/signature_request_api.py b/dropbox_sign/api/signature_request_api.py index 3ce10ed..d95641f 100644 --- a/dropbox_sign/api/signature_request_api.py +++ b/dropbox_sign/api/signature_request_api.py @@ -1,2505 +1,4664 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) - -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.bulk_send_job_send_response import BulkSendJobSendResponse -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.file_response import FileResponse -from dropbox_sign.model.file_response_data_uri import FileResponseDataUri -from dropbox_sign.model.signature_request_bulk_create_embedded_with_template_request import SignatureRequestBulkCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.signature_request_bulk_send_with_template_request import SignatureRequestBulkSendWithTemplateRequest -from dropbox_sign.model.signature_request_create_embedded_request import SignatureRequestCreateEmbeddedRequest -from dropbox_sign.model.signature_request_create_embedded_with_template_request import SignatureRequestCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.signature_request_get_response import SignatureRequestGetResponse -from dropbox_sign.model.signature_request_list_response import SignatureRequestListResponse -from dropbox_sign.model.signature_request_remind_request import SignatureRequestRemindRequest -from dropbox_sign.model.signature_request_send_request import SignatureRequestSendRequest -from dropbox_sign.model.signature_request_send_with_template_request import SignatureRequestSendWithTemplateRequest -from dropbox_sign.model.signature_request_update_request import SignatureRequestUpdateRequest - - -class SignatureRequestApi(object): + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.bulk_send_job_send_response import BulkSendJobSendResponse +from dropbox_sign.models.file_response import FileResponse +from dropbox_sign.models.file_response_data_uri import FileResponseDataUri +from dropbox_sign.models.signature_request_bulk_create_embedded_with_template_request import SignatureRequestBulkCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_bulk_send_with_template_request import SignatureRequestBulkSendWithTemplateRequest +from dropbox_sign.models.signature_request_create_embedded_request import SignatureRequestCreateEmbeddedRequest +from dropbox_sign.models.signature_request_create_embedded_with_template_request import SignatureRequestCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_get_response import SignatureRequestGetResponse +from dropbox_sign.models.signature_request_list_response import SignatureRequestListResponse +from dropbox_sign.models.signature_request_remind_request import SignatureRequestRemindRequest +from dropbox_sign.models.signature_request_send_request import SignatureRequestSendRequest +from dropbox_sign.models.signature_request_send_with_template_request import SignatureRequestSendWithTemplateRequest +from dropbox_sign.models.signature_request_update_request import SignatureRequestUpdateRequest + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class SignatureRequestApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.signature_request_bulk_create_embedded_with_template_endpoint = _Endpoint( - settings={ - 'response_type': (BulkSendJobSendResponse,), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/signature_request/bulk_create_embedded_with_template', - 'operation_id': 'signature_request_bulk_create_embedded_with_template', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_bulk_create_embedded_with_template_request', - ], - 'required': [ - 'signature_request_bulk_create_embedded_with_template_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_bulk_create_embedded_with_template_request': - (SignatureRequestBulkCreateEmbeddedWithTemplateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_bulk_create_embedded_with_template_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_bulk_send_with_template_endpoint = _Endpoint( - settings={ - 'response_type': (BulkSendJobSendResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/bulk_send_with_template', - 'operation_id': 'signature_request_bulk_send_with_template', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_bulk_send_with_template_request', - ], - 'required': [ - 'signature_request_bulk_send_with_template_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_bulk_send_with_template_request': - (SignatureRequestBulkSendWithTemplateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_bulk_send_with_template_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_cancel_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/cancel/{signature_request_id}', - 'operation_id': 'signature_request_cancel', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_create_embedded_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/create_embedded', - 'operation_id': 'signature_request_create_embedded', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_create_embedded_request', - ], - 'required': [ - 'signature_request_create_embedded_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_create_embedded_request': - (SignatureRequestCreateEmbeddedRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_create_embedded_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_create_embedded_with_template_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/create_embedded_with_template', - 'operation_id': 'signature_request_create_embedded_with_template', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_create_embedded_with_template_request', - ], - 'required': [ - 'signature_request_create_embedded_with_template_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_create_embedded_with_template_request': - (SignatureRequestCreateEmbeddedWithTemplateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_create_embedded_with_template_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_files_endpoint = _Endpoint( - settings={ - 'response_type': (file_type,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/files/{signature_request_id}', - 'operation_id': 'signature_request_files', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - 'file_type', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - 'file_type', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('file_type',): { - - "PDF": "pdf", - "ZIP": "zip" - }, - }, - 'openapi_types': { - 'signature_request_id': - (str,), - 'file_type': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - 'file_type': 'file_type', - }, - 'location_map': { - 'signature_request_id': 'path', - 'file_type': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/pdf', - 'application/zip', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_files_as_data_uri_endpoint = _Endpoint( - settings={ - 'response_type': (FileResponseDataUri,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/files_as_data_uri/{signature_request_id}', - 'operation_id': 'signature_request_files_as_data_uri', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_files_as_file_url_endpoint = _Endpoint( - settings={ - 'response_type': (FileResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/files_as_file_url/{signature_request_id}', - 'operation_id': 'signature_request_files_as_file_url', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - 'force_download', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - 'force_download': - (int,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - 'force_download': 'force_download', - }, - 'location_map': { - 'signature_request_id': 'path', - 'force_download': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_get_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/{signature_request_id}', - 'operation_id': 'signature_request_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_list_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestListResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/list', - 'operation_id': 'signature_request_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_id', - 'page', - 'page_size', - 'query', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'page': - (int,), - 'page_size': - (int,), - 'query': - (str,), - }, - 'attribute_map': { - 'account_id': 'account_id', - 'page': 'page', - 'page_size': 'page_size', - 'query': 'query', - }, - 'location_map': { - 'account_id': 'query', - 'page': 'query', - 'page_size': 'query', - 'query': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_release_hold_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/release_hold/{signature_request_id}', - 'operation_id': 'signature_request_release_hold', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_remind_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/remind/{signature_request_id}', - 'operation_id': 'signature_request_remind', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - 'signature_request_remind_request', - ], - 'required': [ - 'signature_request_id', - 'signature_request_remind_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - 'signature_request_remind_request': - (SignatureRequestRemindRequest,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - 'signature_request_remind_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.signature_request_remove_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/signature_request/remove/{signature_request_id}', - 'operation_id': 'signature_request_remove', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - ], - 'required': [ - 'signature_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.signature_request_send_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/send', - 'operation_id': 'signature_request_send', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_send_request', - ], - 'required': [ - 'signature_request_send_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_send_request': - (SignatureRequestSendRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_send_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_send_with_template_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/send_with_template', - 'operation_id': 'signature_request_send_with_template', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_send_with_template_request', - ], - 'required': [ - 'signature_request_send_with_template_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_send_with_template_request': - (SignatureRequestSendWithTemplateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'signature_request_send_with_template_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.signature_request_update_endpoint = _Endpoint( - settings={ - 'response_type': (SignatureRequestGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/signature_request/update/{signature_request_id}', - 'operation_id': 'signature_request_update', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - 'signature_request_update_request', - ], - 'required': [ - 'signature_request_id', - 'signature_request_update_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - 'signature_request_update_request': - (SignatureRequestUpdateRequest,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - 'signature_request_update_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def signature_request_bulk_create_embedded_with_template( self, - signature_request_bulk_create_embedded_with_template_request, - **kwargs + signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BulkSendJobSendResponse: - """Embedded Bulk Send with Template # noqa: E501 - - Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_bulk_create_embedded_with_template(signature_request_bulk_create_embedded_with_template_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_bulk_create_embedded_with_template_request (SignatureRequestBulkCreateEmbeddedWithTemplateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - BulkSendJobSendResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_bulk_create_embedded_with_template_request'] = \ - signature_request_bulk_create_embedded_with_template_request - try: - return self.signature_request_bulk_create_embedded_with_template_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[BulkSendJobSendResponse], - _check_type=True, + """Embedded Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_create_embedded_with_template_request: (required) + :type signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_create_embedded_with_template_serialize( + signature_request_bulk_create_embedded_with_template_request=signature_request_bulk_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_bulk_create_embedded_with_template_with_http_info( + self, + signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BulkSendJobSendResponse]: + """Embedded Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_create_embedded_with_template_request: (required) + :type signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_create_embedded_with_template_serialize( + signature_request_bulk_create_embedded_with_template_request=signature_request_bulk_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_bulk_create_embedded_with_template_without_preload_content( + self, + signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Embedded Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_create_embedded_with_template_request: (required) + :type signature_request_bulk_create_embedded_with_template_request: SignatureRequestBulkCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_create_embedded_with_template_serialize( + signature_request_bulk_create_embedded_with_template_request=signature_request_bulk_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_bulk_create_embedded_with_template_serialize( + self, + signature_request_bulk_create_embedded_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_bulk_create_embedded_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_bulk_create_embedded_with_template_request is not None and has_files is False: + _body_params = signature_request_bulk_create_embedded_with_template_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/bulk_create_embedded_with_template', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e + + + @validate_call def signature_request_bulk_send_with_template( self, - signature_request_bulk_send_with_template_request, - **kwargs + signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BulkSendJobSendResponse: - """Bulk Send with Template # noqa: E501 - - Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_bulk_send_with_template(signature_request_bulk_send_with_template_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_bulk_send_with_template_request (SignatureRequestBulkSendWithTemplateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - BulkSendJobSendResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_bulk_send_with_template_request'] = \ - signature_request_bulk_send_with_template_request - try: - return self.signature_request_bulk_send_with_template_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[BulkSendJobSendResponse], - _check_type=True, + """Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_send_with_template_request: (required) + :type signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_send_with_template_serialize( + signature_request_bulk_send_with_template_request=signature_request_bulk_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_bulk_send_with_template_with_http_info( + self, + signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BulkSendJobSendResponse]: + """Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_send_with_template_request: (required) + :type signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_send_with_template_serialize( + signature_request_bulk_send_with_template_request=signature_request_bulk_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_bulk_send_with_template_without_preload_content( + self, + signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Bulk Send with Template + + Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE:** Only available for Standard plan and higher. + + :param signature_request_bulk_send_with_template_request: (required) + :type signature_request_bulk_send_with_template_request: SignatureRequestBulkSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_bulk_send_with_template_serialize( + signature_request_bulk_send_with_template_request=signature_request_bulk_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BulkSendJobSendResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_bulk_send_with_template_serialize( + self, + signature_request_bulk_send_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_bulk_send_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_bulk_send_with_template_request is not None and has_files is False: + _body_params = signature_request_bulk_send_with_template_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/bulk_send_with_template', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e + + + @validate_call def signature_request_cancel( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the incomplete SignatureRequest to cancel.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Cancel Incomplete Signature Request # noqa: E501 - - Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_cancel(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the incomplete SignatureRequest to cancel. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - return self.signature_request_cancel_endpoint.call_with_http_info(**kwargs) + """Cancel Incomplete Signature Request + + Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. + + :param signature_request_id: The id of the incomplete SignatureRequest to cancel. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_cancel_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_cancel_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the incomplete SignatureRequest to cancel.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Cancel Incomplete Signature Request + + Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. + + :param signature_request_id: The id of the incomplete SignatureRequest to cancel. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_cancel_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_cancel_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the incomplete SignatureRequest to cancel.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Cancel Incomplete Signature Request + + Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE:** To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. + + :param signature_request_id: The id of the incomplete SignatureRequest to cancel. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_cancel_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_cancel_serialize( + self, + signature_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/cancel/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def signature_request_create_embedded( self, - signature_request_create_embedded_request, - **kwargs + signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Create Embedded Signature Request # noqa: E501 - - Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_create_embedded(signature_request_create_embedded_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_create_embedded_request (SignatureRequestCreateEmbeddedRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_create_embedded_request'] = \ - signature_request_create_embedded_request - try: - return self.signature_request_create_embedded_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, + """Create Embedded Signature Request + + Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_request: (required) + :type signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_serialize( + signature_request_create_embedded_request=signature_request_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_create_embedded_with_http_info( + self, + signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Create Embedded Signature Request + + Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_request: (required) + :type signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_serialize( + signature_request_create_embedded_request=signature_request_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_create_embedded_without_preload_content( + self, + signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Embedded Signature Request + + Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_request: (required) + :type signature_request_create_embedded_request: SignatureRequestCreateEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_serialize( + signature_request_create_embedded_request=signature_request_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_create_embedded_serialize( + self, + signature_request_create_embedded_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_create_embedded_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_create_embedded_request is not None and has_files is False: + _body_params = signature_request_create_embedded_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/create_embedded', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def signature_request_create_embedded_with_template( self, - signature_request_create_embedded_with_template_request, - **kwargs + signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Create Embedded Signature Request with Template # noqa: E501 - - Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_create_embedded_with_template(signature_request_create_embedded_with_template_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_create_embedded_with_template_request (SignatureRequestCreateEmbeddedWithTemplateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_create_embedded_with_template_request'] = \ - signature_request_create_embedded_with_template_request - try: - return self.signature_request_create_embedded_with_template_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, + """Create Embedded Signature Request with Template + + Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_with_template_request: (required) + :type signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_with_template_serialize( + signature_request_create_embedded_with_template_request=signature_request_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_create_embedded_with_template_with_http_info( + self, + signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Create Embedded Signature Request with Template + + Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_with_template_request: (required) + :type signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_with_template_serialize( + signature_request_create_embedded_with_template_request=signature_request_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_create_embedded_with_template_without_preload_content( + self, + signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Embedded Signature Request with Template + + Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. + + :param signature_request_create_embedded_with_template_request: (required) + :type signature_request_create_embedded_with_template_request: SignatureRequestCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_create_embedded_with_template_serialize( + signature_request_create_embedded_with_template_request=signature_request_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_create_embedded_with_template_serialize( + self, + signature_request_create_embedded_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_create_embedded_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_create_embedded_with_template_request is not None and has_files is False: + _body_params = signature_request_create_embedded_with_template_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/create_embedded_with_template', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def signature_request_files( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> io.IOBase: + """Download Files + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_files_serialize( + signature_request_id=signature_request_id, + file_type=file_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "io.IOBase", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_files_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[io.IOBase]: + """Download Files + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_files_serialize( + signature_request_id=signature_request_id, + file_type=file_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "io.IOBase", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_files_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download Files + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_files_serialize( + signature_request_id=signature_request_id, + file_type=file_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "io.IOBase", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_files_serialize( self, signature_request_id, - **kwargs - ) -> file_type: - """Download Files # noqa: E501 - - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_files(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to retrieve. - - Keyword Args: - file_type (str): Set to `pdf` for a single merged document or `zip` for a collection of individual documents.. [optional] if omitted the server will use the default value of "pdf" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - try: - return self.signature_request_files_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[file_type], - _check_type=True, - ) + file_type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + if file_type is not None: + + _query_params.append(('file_type', file_type)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/pdf', + 'application/zip', + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/signature_request/files/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def signature_request_files_as_data_uri( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FileResponseDataUri: - """Download Files as Data Uri # noqa: E501 - - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_files_as_data_uri(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - FileResponseDataUri - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - try: - return self.signature_request_files_as_data_uri_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[FileResponseDataUri], - _check_type=True, - ) + """Download Files as Data Uri + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_files_as_data_uri_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_files_as_data_uri_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FileResponseDataUri]: + """Download Files as Data Uri + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_files_as_data_uri_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_files_as_data_uri_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download Files as Data Uri + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_files_as_data_uri_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_files_as_data_uri_serialize( + self, + signature_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] - raise e + return self.api_client.param_serialize( + method='GET', + resource_path='/signature_request/files_as_data_uri/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def signature_request_files_as_file_url( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FileResponse: - """Download Files as File Url # noqa: E501 - - Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_files_as_file_url(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to retrieve. - - Keyword Args: - force_download (int): By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.. [optional] if omitted the server will use the default value of 1 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - FileResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - try: - return self.signature_request_files_as_file_url_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[FileResponse], - _check_type=True, - ) + """Download Files as File Url + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_files_as_file_url_serialize( + signature_request_id=signature_request_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_files_as_file_url_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FileResponse]: + """Download Files as File Url + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_files_as_file_url_serialize( + signature_request_id=signature_request_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_files_as_file_url_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download Files as File Url + + Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_files_as_file_url_serialize( + signature_request_id=signature_request_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_files_as_file_url_serialize( + self, + signature_request_id, + force_download, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + if force_download is not None: + + _query_params.append(('force_download', force_download)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/signature_request/files_as_file_url/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def signature_request_get( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Get Signature Request # noqa: E501 - - Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_get(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - try: - return self.signature_request_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, - ) + """Get Signature Request + + Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_get_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_get_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Get Signature Request + + Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_get_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_get_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Signature Request + + Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. + + :param signature_request_id: The id of the SignatureRequest to retrieve. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_get_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_get_serialize( + self, + signature_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/signature_request/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def signature_request_list( self, - **kwargs + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SignatureRequest List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the SignatureRequest objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestListResponse: - """List Signature Requests # noqa: E501 - - Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - account_id (str): Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.. [optional] - page (int): Which page number of the SignatureRequest List to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.. [optional] if omitted the server will use the default value of 20 - query (str): String that includes search terms and/or fields to be used to filter the SignatureRequest objects.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.signature_request_list_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestListResponse], - _check_type=True, - ) + """List Signature Requests + + Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. + + :param account_id: Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the SignatureRequest List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the SignatureRequest objects. + :type query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_list_with_http_info( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SignatureRequest List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the SignatureRequest objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestListResponse]: + """List Signature Requests + + Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. + + :param account_id: Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the SignatureRequest List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the SignatureRequest objects. + :type query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_list_without_preload_content( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SignatureRequest List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[StrictInt], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the SignatureRequest objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Signature Requests + + Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. + + :param account_id: Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the SignatureRequest List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the SignatureRequest objects. + :type query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_list_serialize( + self, + account_id, + page, + page_size, + query, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if account_id is not None: + + _query_params.append(('account_id', account_id)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if query is not None: + + _query_params.append(('query', query)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/signature_request/list', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def signature_request_release_hold( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to release.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Release On-Hold Signature Request # noqa: E501 - - Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_release_hold(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to release. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - try: - return self.signature_request_release_hold_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, - ) + """Release On-Hold Signature Request + + Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. + + :param signature_request_id: The id of the SignatureRequest to release. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_release_hold_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_release_hold_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to release.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Release On-Hold Signature Request + + Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. + + :param signature_request_id: The id of the SignatureRequest to release. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_release_hold_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_release_hold_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to release.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Release On-Hold Signature Request + + Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. + + :param signature_request_id: The id of the SignatureRequest to release. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_release_hold_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_release_hold_serialize( + self, + signature_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/release_hold/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def signature_request_remind( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to send a reminder for.")], + signature_request_remind_request: SignatureRequestRemindRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignatureRequestGetResponse: + """Send Request Reminder + + Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. + + :param signature_request_id: The id of the SignatureRequest to send a reminder for. (required) + :type signature_request_id: str + :param signature_request_remind_request: (required) + :type signature_request_remind_request: SignatureRequestRemindRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_remind_serialize( + signature_request_id=signature_request_id, + signature_request_remind_request=signature_request_remind_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_remind_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to send a reminder for.")], + signature_request_remind_request: SignatureRequestRemindRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Send Request Reminder + + Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. + + :param signature_request_id: The id of the SignatureRequest to send a reminder for. (required) + :type signature_request_id: str + :param signature_request_remind_request: (required) + :type signature_request_remind_request: SignatureRequestRemindRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_remind_serialize( + signature_request_id=signature_request_id, + signature_request_remind_request=signature_request_remind_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_remind_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to send a reminder for.")], + signature_request_remind_request: SignatureRequestRemindRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Send Request Reminder + + Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. + + :param signature_request_id: The id of the SignatureRequest to send a reminder for. (required) + :type signature_request_id: str + :param signature_request_remind_request: (required) + :type signature_request_remind_request: SignatureRequestRemindRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_remind_serialize( + signature_request_id=signature_request_id, + signature_request_remind_request=signature_request_remind_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_remind_serialize( self, signature_request_id, signature_request_remind_request, - **kwargs - ) -> SignatureRequestGetResponse: - """Send Request Reminder # noqa: E501 - - Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE:** This action can **not** be used with embedded signature requests. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_remind(signature_request_id, signature_request_remind_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to send a reminder for. - signature_request_remind_request (SignatureRequestRemindRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - kwargs['signature_request_remind_request'] = \ - signature_request_remind_request - try: - return self.signature_request_remind_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_remind_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_remind_request is not None and has_files is False: + _body_params = signature_request_remind_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/remind/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def signature_request_remove( self, - signature_request_id, - **kwargs + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to remove.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Remove Signature Request Access # noqa: E501 - - Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_remove(signature_request_id, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to remove. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - return self.signature_request_remove_endpoint.call_with_http_info(**kwargs) + """Remove Signature Request Access + + Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. + + :param signature_request_id: The id of the SignatureRequest to remove. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_remove_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_remove_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to remove.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove Signature Request Access + + Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. + + :param signature_request_id: The id of the SignatureRequest to remove. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_remove_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_remove_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to remove.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove Signature Request Access + + Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. + + :param signature_request_id: The id of the SignatureRequest to remove. (required) + :type signature_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_remove_serialize( + signature_request_id=signature_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_remove_serialize( + self, + signature_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/remove/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def signature_request_send( self, - signature_request_send_request, - **kwargs + signature_request_send_request: SignatureRequestSendRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Send Signature Request # noqa: E501 - - Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_send(signature_request_send_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_send_request (SignatureRequestSendRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_send_request'] = \ - signature_request_send_request - try: - return self.signature_request_send_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, + """Send Signature Request + + Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. + + :param signature_request_send_request: (required) + :type signature_request_send_request: SignatureRequestSendRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_serialize( + signature_request_send_request=signature_request_send_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_send_with_http_info( + self, + signature_request_send_request: SignatureRequestSendRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Send Signature Request + + Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. + + :param signature_request_send_request: (required) + :type signature_request_send_request: SignatureRequestSendRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_serialize( + signature_request_send_request=signature_request_send_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_send_without_preload_content( + self, + signature_request_send_request: SignatureRequestSendRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Send Signature Request + + Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. + + :param signature_request_send_request: (required) + :type signature_request_send_request: SignatureRequestSendRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_serialize( + signature_request_send_request=signature_request_send_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_send_serialize( + self, + signature_request_send_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_send_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_send_request is not None and has_files is False: + _body_params = signature_request_send_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/send', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def signature_request_send_with_template( self, - signature_request_send_with_template_request, - **kwargs + signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SignatureRequestGetResponse: - """Send with Template # noqa: E501 - - Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_send_with_template(signature_request_send_with_template_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_send_with_template_request (SignatureRequestSendWithTemplateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_send_with_template_request'] = \ - signature_request_send_with_template_request - try: - return self.signature_request_send_with_template_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, + """Send with Template + + Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. + + :param signature_request_send_with_template_request: (required) + :type signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_with_template_serialize( + signature_request_send_with_template_request=signature_request_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_send_with_template_with_http_info( + self, + signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Send with Template + + Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. + + :param signature_request_send_with_template_request: (required) + :type signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_with_template_serialize( + signature_request_send_with_template_request=signature_request_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_send_with_template_without_preload_content( + self, + signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Send with Template + + Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. + + :param signature_request_send_with_template_request: (required) + :type signature_request_send_with_template_request: SignatureRequestSendWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_send_with_template_serialize( + signature_request_send_with_template_request=signature_request_send_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_send_with_template_serialize( + self, + signature_request_send_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_send_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_send_with_template_request is not None and has_files is False: + _body_params = signature_request_send_with_template_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/send_with_template', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def signature_request_update( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to update.")], + signature_request_update_request: SignatureRequestUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SignatureRequestGetResponse: + """Update Signature Request + + Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. + + :param signature_request_id: The id of the SignatureRequest to update. (required) + :type signature_request_id: str + :param signature_request_update_request: (required) + :type signature_request_update_request: SignatureRequestUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_update_serialize( + signature_request_id=signature_request_id, + signature_request_update_request=signature_request_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def signature_request_update_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to update.")], + signature_request_update_request: SignatureRequestUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SignatureRequestGetResponse]: + """Update Signature Request + + Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. + + :param signature_request_id: The id of the SignatureRequest to update. (required) + :type signature_request_id: str + :param signature_request_update_request: (required) + :type signature_request_update_request: SignatureRequestUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_update_serialize( + signature_request_id=signature_request_id, + signature_request_update_request=signature_request_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def signature_request_update_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The id of the SignatureRequest to update.")], + signature_request_update_request: SignatureRequestUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Signature Request + + Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. + + :param signature_request_id: The id of the SignatureRequest to update. (required) + :type signature_request_id: str + :param signature_request_update_request: (required) + :type signature_request_update_request: SignatureRequestUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._signature_request_update_serialize( + signature_request_id=signature_request_id, + signature_request_update_request=signature_request_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SignatureRequestGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _signature_request_update_serialize( self, signature_request_id, signature_request_update_request, - **kwargs - ) -> SignatureRequestGetResponse: - """Update Signature Request # noqa: E501 - - Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE:** This action cannot be performed on a signature request with an appended signature page. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.signature_request_update(signature_request_id, signature_request_update_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The id of the SignatureRequest to update. - signature_request_update_request (SignatureRequestUpdateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - SignatureRequestGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - kwargs['signature_request_update_request'] = \ - signature_request_update_request - try: - return self.signature_request_update_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[SignatureRequestGetResponse], - _check_type=True, - ) - - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = signature_request_update_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if signature_request_update_request is not None and has_files is False: + _body_params = signature_request_update_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/signature_request/update/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/dropbox_sign/api/team_api.py b/dropbox_sign/api/team_api.py index 98dc215..a4c5db6 100644 --- a/dropbox_sign/api/team_api.py +++ b/dropbox_sign/api/team_api.py @@ -1,1557 +1,2878 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - + Generated by OpenAPI Generator (https://openapi-generator.tech) -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.team_add_member_request import TeamAddMemberRequest -from dropbox_sign.model.team_create_request import TeamCreateRequest -from dropbox_sign.model.team_get_info_response import TeamGetInfoResponse -from dropbox_sign.model.team_get_response import TeamGetResponse -from dropbox_sign.model.team_invites_response import TeamInvitesResponse -from dropbox_sign.model.team_members_response import TeamMembersResponse -from dropbox_sign.model.team_remove_member_request import TeamRemoveMemberRequest -from dropbox_sign.model.team_sub_teams_response import TeamSubTeamsResponse -from dropbox_sign.model.team_update_request import TeamUpdateRequest - - -class TeamApi(object): + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from dropbox_sign.models.team_add_member_request import TeamAddMemberRequest +from dropbox_sign.models.team_create_request import TeamCreateRequest +from dropbox_sign.models.team_get_info_response import TeamGetInfoResponse +from dropbox_sign.models.team_get_response import TeamGetResponse +from dropbox_sign.models.team_invites_response import TeamInvitesResponse +from dropbox_sign.models.team_members_response import TeamMembersResponse +from dropbox_sign.models.team_remove_member_request import TeamRemoveMemberRequest +from dropbox_sign.models.team_sub_teams_response import TeamSubTeamsResponse +from dropbox_sign.models.team_update_request import TeamUpdateRequest + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class TeamApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.team_add_member_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/add_member', - 'operation_id': 'team_add_member', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_add_member_request', - 'team_id', - ], - 'required': [ - 'team_add_member_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_add_member_request': - (TeamAddMemberRequest,), - 'team_id': - (str,), - }, - 'attribute_map': { - 'team_id': 'team_id', - }, - 'location_map': { - 'team_add_member_request': 'body', - 'team_id': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.team_create_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/create', - 'operation_id': 'team_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_create_request', - ], - 'required': [ - 'team_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_create_request': - (TeamCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'team_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.team_delete_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/destroy', - 'operation_id': 'team_delete', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_get_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team', - 'operation_id': 'team_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_info_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetInfoResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/info', - 'operation_id': 'team_info', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_id', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_id': - (str,), - }, - 'attribute_map': { - 'team_id': 'team_id', - }, - 'location_map': { - 'team_id': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_invites_endpoint = _Endpoint( - settings={ - 'response_type': (TeamInvitesResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/invites', - 'operation_id': 'team_invites', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'email_address', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'email_address': - (str,), - }, - 'attribute_map': { - 'email_address': 'email_address', - }, - 'location_map': { - 'email_address': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_members_endpoint = _Endpoint( - settings={ - 'response_type': (TeamMembersResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/members/{team_id}', - 'operation_id': 'team_members', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_id', - 'page', - 'page_size', - ], - 'required': [ - 'team_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'page_size', - ] - }, - root_map={ - 'validations': { - ('page_size',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_id': - (str,), - 'page': - (int,), - 'page_size': - (int,), - }, - 'attribute_map': { - 'team_id': 'team_id', - 'page': 'page', - 'page_size': 'page_size', - }, - 'location_map': { - 'team_id': 'path', - 'page': 'query', - 'page_size': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_remove_member_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/remove_member', - 'operation_id': 'team_remove_member', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_remove_member_request', - ], - 'required': [ - 'team_remove_member_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_remove_member_request': - (TeamRemoveMemberRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'team_remove_member_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.team_sub_teams_endpoint = _Endpoint( - settings={ - 'response_type': (TeamSubTeamsResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team/sub_teams/{team_id}', - 'operation_id': 'team_sub_teams', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_id', - 'page', - 'page_size', - ], - 'required': [ - 'team_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'page_size', - ] - }, - root_map={ - 'validations': { - ('page_size',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_id': - (str,), - 'page': - (int,), - 'page_size': - (int,), - }, - 'attribute_map': { - 'team_id': 'team_id', - 'page': 'page', - 'page_size': 'page_size', - }, - 'location_map': { - 'team_id': 'path', - 'page': 'query', - 'page_size': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.team_update_endpoint = _Endpoint( - settings={ - 'response_type': (TeamGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/team', - 'operation_id': 'team_update', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'team_update_request', - ], - 'required': [ - 'team_update_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'team_update_request': - (TeamUpdateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'team_update_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def team_add_member( self, - team_add_member_request, - **kwargs + team_add_member_request: TeamAddMemberRequest, + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TeamGetResponse: - """Add User to Team # noqa: E501 - - Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_add_member(team_add_member_request, async_req=True) - >>> result = thread.get() - - Args: - team_add_member_request (TeamAddMemberRequest): - - Keyword Args: - team_id (str): The id of the team.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_add_member_request'] = \ - team_add_member_request - try: - return self.team_add_member_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetResponse], - _check_type=True, + """Add User to Team + + Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. + + :param team_add_member_request: (required) + :type team_add_member_request: TeamAddMemberRequest + :param team_id: The id of the team. + :type team_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_add_member_serialize( + team_add_member_request=team_add_member_request, + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def team_add_member_with_http_info( + self, + team_add_member_request: TeamAddMemberRequest, + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TeamGetResponse]: + """Add User to Team + + Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. + + :param team_add_member_request: (required) + :type team_add_member_request: TeamAddMemberRequest + :param team_id: The id of the team. + :type team_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_add_member_serialize( + team_add_member_request=team_add_member_request, + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def team_add_member_without_preload_content( + self, + team_add_member_request: TeamAddMemberRequest, + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add User to Team + + Invites a user (specified using the `email_address` parameter) to your Team. If the user does not currently have a Dropbox Sign Account, a new one will be created for them. If a user is already a part of another Team, a `team_invite_failed` error will be returned. + + :param team_add_member_request: (required) + :type team_add_member_request: TeamAddMemberRequest + :param team_id: The id of the team. + :type team_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_add_member_serialize( + team_add_member_request=team_add_member_request, + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_add_member_serialize( + self, + team_add_member_request, + team_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = team_add_member_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + if team_id is not None: + + _query_params.append(('team_id', team_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + if team_add_member_request is not None and has_files is False: + _body_params = team_add_member_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/team/add_member', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def team_create( self, - team_create_request, - **kwargs + team_create_request: TeamCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TeamGetResponse: - """Create Team # noqa: E501 - - Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_create(team_create_request, async_req=True) - >>> result = thread.get() - - Args: - team_create_request (TeamCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_create_request'] = \ - team_create_request - try: - return self.team_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetResponse], - _check_type=True, + """Create Team + + Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. + + :param team_create_request: (required) + :type team_create_request: TeamCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_create_serialize( + team_create_request=team_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def team_create_with_http_info( + self, + team_create_request: TeamCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TeamGetResponse]: + """Create Team + + Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. + + :param team_create_request: (required) + :type team_create_request: TeamCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_create_serialize( + team_create_request=team_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def team_create_without_preload_content( + self, + team_create_request: TeamCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Team + + Creates a new Team and makes you a member. You must not currently belong to a Team to invoke. + + :param team_create_request: (required) + :type team_create_request: TeamCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_create_serialize( + team_create_request=team_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_create_serialize( + self, + team_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = team_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if team_create_request is not None and has_files is False: + _body_params = team_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/team/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def team_delete( self, - **kwargs + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete Team # noqa: E501 - - Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_delete(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - return self.team_delete_endpoint.call_with_http_info(**kwargs) + """Delete Team + + Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_delete_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def team_delete_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Team + + Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_delete_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def team_delete_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Team + + Deletes your Team. Can only be invoked when you have a Team with only one member (yourself). + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_delete_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_delete_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/team/destroy', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def team_get( self, - **kwargs + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TeamGetResponse: - """Get Team # noqa: E501 - - Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.team_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetResponse], - _check_type=True, - ) + """Get Team + + Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def team_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TeamGetResponse]: + """Get Team + + Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def team_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Team + + Returns information about your Team as well as a list of its members. If you do not belong to a Team, a 404 error with an error_name of \"not_found\" will be returned. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/team', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def team_info( self, - **kwargs + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TeamGetInfoResponse: - """Get Team Info # noqa: E501 - - Provides information about a team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_info(async_req=True) - >>> result = thread.get() - - - Keyword Args: - team_id (str): The id of the team.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetInfoResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.team_info_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetInfoResponse], - _check_type=True, - ) + """Get Team Info + + Provides information about a team. + + :param team_id: The id of the team. + :type team_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_info_serialize( + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetInfoResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def team_info_with_http_info( + self, + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TeamGetInfoResponse]: + """Get Team Info + + Provides information about a team. + + :param team_id: The id of the team. + :type team_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_info_serialize( + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetInfoResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def team_info_without_preload_content( + self, + team_id: Annotated[Optional[StrictStr], Field(description="The id of the team.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Team Info + + Provides information about a team. + + :param team_id: The id of the team. + :type team_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_info_serialize( + team_id=team_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetInfoResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_info_serialize( + self, + team_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if team_id is not None: + + _query_params.append(('team_id', team_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/team/info', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def team_invites( self, - **kwargs + email_address: Annotated[Optional[StrictStr], Field(description="The email address for which to display the team invites.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TeamInvitesResponse: - """List Team Invites # noqa: E501 - - Provides a list of team invites (and their roles). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_invites(async_req=True) - >>> result = thread.get() - - - Keyword Args: - email_address (str): The email address for which to display the team invites.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamInvitesResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.team_invites_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamInvitesResponse], - _check_type=True, - ) + """List Team Invites + + Provides a list of team invites (and their roles). + + :param email_address: The email address for which to display the team invites. + :type email_address: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_invites_serialize( + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamInvitesResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def team_invites_with_http_info( + self, + email_address: Annotated[Optional[StrictStr], Field(description="The email address for which to display the team invites.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TeamInvitesResponse]: + """List Team Invites + + Provides a list of team invites (and their roles). + + :param email_address: The email address for which to display the team invites. + :type email_address: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_invites_serialize( + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamInvitesResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def team_invites_without_preload_content( + self, + email_address: Annotated[Optional[StrictStr], Field(description="The email address for which to display the team invites.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Team Invites + + Provides a list of team invites (and their roles). + + :param email_address: The email address for which to display the team invites. + :type email_address: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_invites_serialize( + email_address=email_address, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamInvitesResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_invites_serialize( + self, + email_address, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if email_address is not None: + + _query_params.append(('email_address', email_address)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/team/invites', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def team_members( self, - team_id, - **kwargs + team_id: Annotated[StrictStr, Field(description="The id of the team that a member list is being requested from.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the team member list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TeamMembersResponse: - """List Team Members # noqa: E501 - - Provides a paginated list of members (and their roles) that belong to a given team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_members(team_id, async_req=True) - >>> result = thread.get() - - Args: - team_id (str): The id of the team that a member list is being requested from. - - Keyword Args: - page (int): Which page number of the team member list to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.. [optional] if omitted the server will use the default value of 20 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamMembersResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_id'] = \ - team_id - try: - return self.team_members_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamMembersResponse], - _check_type=True, - ) + """List Team Members + + Provides a paginated list of members (and their roles) that belong to a given team. + + :param team_id: The id of the team that a member list is being requested from. (required) + :type team_id: str + :param page: Which page number of the team member list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_members_serialize( + team_id=team_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamMembersResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def team_members_with_http_info( + self, + team_id: Annotated[StrictStr, Field(description="The id of the team that a member list is being requested from.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the team member list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TeamMembersResponse]: + """List Team Members + + Provides a paginated list of members (and their roles) that belong to a given team. + + :param team_id: The id of the team that a member list is being requested from. (required) + :type team_id: str + :param page: Which page number of the team member list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_members_serialize( + team_id=team_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamMembersResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def team_members_without_preload_content( + self, + team_id: Annotated[StrictStr, Field(description="The id of the team that a member list is being requested from.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the team member list to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Team Members + + Provides a paginated list of members (and their roles) that belong to a given team. + + :param team_id: The id of the team that a member list is being requested from. (required) + :type team_id: str + :param page: Which page number of the team member list to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_members_serialize( + team_id=team_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamMembersResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_members_serialize( + self, + team_id, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if team_id is not None: + _path_params['team_id'] = team_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/team/members/{team_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e + + + @validate_call def team_remove_member( self, - team_remove_member_request, - **kwargs + team_remove_member_request: TeamRemoveMemberRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TeamGetResponse: - """Remove User from Team # noqa: E501 - - Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_remove_member(team_remove_member_request, async_req=True) - >>> result = thread.get() - - Args: - team_remove_member_request (TeamRemoveMemberRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_remove_member_request'] = \ - team_remove_member_request - try: - return self.team_remove_member_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 201: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetResponse], - _check_type=True, + """Remove User from Team + + Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. + + :param team_remove_member_request: (required) + :type team_remove_member_request: TeamRemoveMemberRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_remove_member_serialize( + team_remove_member_request=team_remove_member_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def team_remove_member_with_http_info( + self, + team_remove_member_request: TeamRemoveMemberRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TeamGetResponse]: + """Remove User from Team + + Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. + + :param team_remove_member_request: (required) + :type team_remove_member_request: TeamRemoveMemberRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_remove_member_serialize( + team_remove_member_request=team_remove_member_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def team_remove_member_without_preload_content( + self, + team_remove_member_request: TeamRemoveMemberRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove User from Team + + Removes the provided user Account from your Team. If the Account had an outstanding invitation to your Team, the invitation will be expired. If you choose to transfer documents from the removed Account to an Account provided in the `new_owner_email_address` parameter (available only for Enterprise plans), the response status code will be 201, which indicates that your request has been queued but not fully executed. + + :param team_remove_member_request: (required) + :type team_remove_member_request: TeamRemoveMemberRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_remove_member_serialize( + team_remove_member_request=team_remove_member_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_remove_member_serialize( + self, + team_remove_member_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = team_remove_member_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if team_remove_member_request is not None and has_files is False: + _body_params = team_remove_member_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/team/remove_member', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def team_sub_teams( self, - team_id, - **kwargs + team_id: Annotated[StrictStr, Field(description="The id of the parent Team.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SubTeam List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TeamSubTeamsResponse: - """List Sub Teams # noqa: E501 - - Provides a paginated list of sub teams that belong to a given team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_sub_teams(team_id, async_req=True) - >>> result = thread.get() - - Args: - team_id (str): The id of the parent Team. - - Keyword Args: - page (int): Which page number of the SubTeam List to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.. [optional] if omitted the server will use the default value of 20 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamSubTeamsResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_id'] = \ - team_id - try: - return self.team_sub_teams_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamSubTeamsResponse], - _check_type=True, - ) + """List Sub Teams + + Provides a paginated list of sub teams that belong to a given team. + + :param team_id: The id of the parent Team. (required) + :type team_id: str + :param page: Which page number of the SubTeam List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_sub_teams_serialize( + team_id=team_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamSubTeamsResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def team_sub_teams_with_http_info( + self, + team_id: Annotated[StrictStr, Field(description="The id of the parent Team.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SubTeam List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TeamSubTeamsResponse]: + """List Sub Teams + + Provides a paginated list of sub teams that belong to a given team. + + :param team_id: The id of the parent Team. (required) + :type team_id: str + :param page: Which page number of the SubTeam List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_sub_teams_serialize( + team_id=team_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamSubTeamsResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def team_sub_teams_without_preload_content( + self, + team_id: Annotated[StrictStr, Field(description="The id of the parent Team.")], + page: Annotated[Optional[StrictInt], Field(description="Which page number of the SubTeam List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Sub Teams + + Provides a paginated list of sub teams that belong to a given team. + + :param team_id: The id of the parent Team. (required) + :type team_id: str + :param page: Which page number of the SubTeam List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_sub_teams_serialize( + team_id=team_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamSubTeamsResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_sub_teams_serialize( + self, + team_id, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if team_id is not None: + _path_params['team_id'] = team_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/team/sub_teams/{team_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e + + + @validate_call def team_update( self, - team_update_request, - **kwargs + team_update_request: TeamUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TeamGetResponse: - """Update Team # noqa: E501 - - Updates the name of your Team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.team_update(team_update_request, async_req=True) - >>> result = thread.get() - - Args: - team_update_request (TeamUpdateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TeamGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['team_update_request'] = \ - team_update_request - try: - return self.team_update_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TeamGetResponse], - _check_type=True, - ) - - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + """Update Team + + Updates the name of your Team. + + :param team_update_request: (required) + :type team_update_request: TeamUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_update_serialize( + team_update_request=team_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def team_update_with_http_info( + self, + team_update_request: TeamUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TeamGetResponse]: + """Update Team + + Updates the name of your Team. + + :param team_update_request: (required) + :type team_update_request: TeamUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_update_serialize( + team_update_request=team_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def team_update_without_preload_content( + self, + team_update_request: TeamUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Team + + Updates the name of your Team. + + :param team_update_request: (required) + :type team_update_request: TeamUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._team_update_serialize( + team_update_request=team_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TeamGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _team_update_serialize( + self, + team_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = team_update_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if team_update_request is not None and has_files is False: + _body_params = team_update_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/team', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/dropbox_sign/api/template_api.py b/dropbox_sign/api/template_api.py index aa5eed8..459469f 100644 --- a/dropbox_sign/api/template_api.py +++ b/dropbox_sign/api/template_api.py @@ -1,1778 +1,3257 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - + Generated by OpenAPI Generator (https://openapi-generator.tech) -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.file_response import FileResponse -from dropbox_sign.model.file_response_data_uri import FileResponseDataUri -from dropbox_sign.model.template_add_user_request import TemplateAddUserRequest -from dropbox_sign.model.template_create_embedded_draft_request import TemplateCreateEmbeddedDraftRequest -from dropbox_sign.model.template_create_embedded_draft_response import TemplateCreateEmbeddedDraftResponse -from dropbox_sign.model.template_create_request import TemplateCreateRequest -from dropbox_sign.model.template_create_response import TemplateCreateResponse -from dropbox_sign.model.template_get_response import TemplateGetResponse -from dropbox_sign.model.template_list_response import TemplateListResponse -from dropbox_sign.model.template_remove_user_request import TemplateRemoveUserRequest -from dropbox_sign.model.template_update_files_request import TemplateUpdateFilesRequest -from dropbox_sign.model.template_update_files_response import TemplateUpdateFilesResponse - - -class TemplateApi(object): + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.file_response import FileResponse +from dropbox_sign.models.file_response_data_uri import FileResponseDataUri +from dropbox_sign.models.template_add_user_request import TemplateAddUserRequest +from dropbox_sign.models.template_create_embedded_draft_request import TemplateCreateEmbeddedDraftRequest +from dropbox_sign.models.template_create_embedded_draft_response import TemplateCreateEmbeddedDraftResponse +from dropbox_sign.models.template_create_request import TemplateCreateRequest +from dropbox_sign.models.template_create_response import TemplateCreateResponse +from dropbox_sign.models.template_get_response import TemplateGetResponse +from dropbox_sign.models.template_list_response import TemplateListResponse +from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest +from dropbox_sign.models.template_update_files_request import TemplateUpdateFilesRequest +from dropbox_sign.models.template_update_files_response import TemplateUpdateFilesResponse + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io + + +class TemplateApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.template_add_user_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/add_user/{template_id}', - 'operation_id': 'template_add_user', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'template_add_user_request', - ], - 'required': [ - 'template_id', - 'template_add_user_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - 'template_add_user_request': - (TemplateAddUserRequest,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - 'template_add_user_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.template_create_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/create', - 'operation_id': 'template_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_create_request', - ], - 'required': [ - 'template_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_create_request': - (TemplateCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'template_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.template_create_embedded_draft_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateCreateEmbeddedDraftResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/create_embedded_draft', - 'operation_id': 'template_create_embedded_draft', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_create_embedded_draft_request', - ], - 'required': [ - 'template_create_embedded_draft_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_create_embedded_draft_request': - (TemplateCreateEmbeddedDraftRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'template_create_embedded_draft_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.template_delete_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/delete/{template_id}', - 'operation_id': 'template_delete', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - ], - 'required': [ - 'template_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_files_endpoint = _Endpoint( - settings={ - 'response_type': (file_type,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/files/{template_id}', - 'operation_id': 'template_files', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'file_type', - ], - 'required': [ - 'template_id', - ], - 'nullable': [ - ], - 'enum': [ - 'file_type', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('file_type',): { - - "PDF": "pdf", - "ZIP": "zip" - }, - }, - 'openapi_types': { - 'template_id': - (str,), - 'file_type': - (str,), - }, - 'attribute_map': { - 'template_id': 'template_id', - 'file_type': 'file_type', - }, - 'location_map': { - 'template_id': 'path', - 'file_type': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/pdf', - 'application/zip', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_files_as_data_uri_endpoint = _Endpoint( - settings={ - 'response_type': (FileResponseDataUri,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/files_as_data_uri/{template_id}', - 'operation_id': 'template_files_as_data_uri', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - ], - 'required': [ - 'template_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_files_as_file_url_endpoint = _Endpoint( - settings={ - 'response_type': (FileResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/files_as_file_url/{template_id}', - 'operation_id': 'template_files_as_file_url', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'force_download', - ], - 'required': [ - 'template_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - 'force_download': - (int,), - }, - 'attribute_map': { - 'template_id': 'template_id', - 'force_download': 'force_download', - }, - 'location_map': { - 'template_id': 'path', - 'force_download': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_get_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/{template_id}', - 'operation_id': 'template_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - ], - 'required': [ - 'template_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_list_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateListResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/list', - 'operation_id': 'template_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'account_id', - 'page', - 'page_size', - 'query', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'page_size', - ] - }, - root_map={ - 'validations': { - ('page_size',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'account_id': - (str,), - 'page': - (int,), - 'page_size': - (int,), - 'query': - (str,), - }, - 'attribute_map': { - 'account_id': 'account_id', - 'page': 'page', - 'page_size': 'page_size', - 'query': 'query', - }, - 'location_map': { - 'account_id': 'query', - 'page': 'query', - 'page_size': 'query', - 'query': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.template_remove_user_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateGetResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/remove_user/{template_id}', - 'operation_id': 'template_remove_user', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'template_remove_user_request', - ], - 'required': [ - 'template_id', - 'template_remove_user_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - 'template_remove_user_request': - (TemplateRemoveUserRequest,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - 'template_remove_user_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.template_update_files_endpoint = _Endpoint( - settings={ - 'response_type': (TemplateUpdateFilesResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/template/update_files/{template_id}', - 'operation_id': 'template_update_files', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'template_id', - 'template_update_files_request', - ], - 'required': [ - 'template_id', - 'template_update_files_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'template_id': - (str,), - 'template_update_files_request': - (TemplateUpdateFilesRequest,), - }, - 'attribute_map': { - 'template_id': 'template_id', - }, - 'location_map': { - 'template_id': 'path', - 'template_update_files_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) + + @validate_call def template_add_user( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to give the Account access to.")], + template_add_user_request: TemplateAddUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplateGetResponse: + """Add User to Template + + Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. + + :param template_id: The id of the Template to give the Account access to. (required) + :type template_id: str + :param template_add_user_request: (required) + :type template_add_user_request: TemplateAddUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_add_user_serialize( + template_id=template_id, + template_add_user_request=template_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_add_user_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to give the Account access to.")], + template_add_user_request: TemplateAddUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplateGetResponse]: + """Add User to Template + + Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. + + :param template_id: The id of the Template to give the Account access to. (required) + :type template_id: str + :param template_add_user_request: (required) + :type template_add_user_request: TemplateAddUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_add_user_serialize( + template_id=template_id, + template_add_user_request=template_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_add_user_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to give the Account access to.")], + template_add_user_request: TemplateAddUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add User to Template + + Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. + + :param template_id: The id of the Template to give the Account access to. (required) + :type template_id: str + :param template_add_user_request: (required) + :type template_add_user_request: TemplateAddUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_add_user_serialize( + template_id=template_id, + template_add_user_request=template_add_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_add_user_serialize( self, template_id, template_add_user_request, - **kwargs - ) -> TemplateGetResponse: - """Add User to Template # noqa: E501 - - Gives the specified Account access to the specified Template. The specified Account must be a part of your Team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_add_user(template_id, template_add_user_request, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the Template to give the Account access to. - template_add_user_request (TemplateAddUserRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - kwargs['template_add_user_request'] = \ - template_add_user_request - try: - return self.template_add_user_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateGetResponse], - _check_type=True, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = template_add_user_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if template_add_user_request is not None and has_files is False: + _body_params = template_add_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/add_user/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def template_create( self, - template_create_request, - **kwargs + template_create_request: TemplateCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TemplateCreateResponse: - """Create Template # noqa: E501 - - Creates a template that can then be used. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_create(template_create_request, async_req=True) - >>> result = thread.get() - - Args: - template_create_request (TemplateCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_create_request'] = \ - template_create_request - try: - return self.template_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateCreateResponse], - _check_type=True, + """Create Template + + Creates a template that can then be used. + + :param template_create_request: (required) + :type template_create_request: TemplateCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_create_serialize( + template_create_request=template_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_create_with_http_info( + self, + template_create_request: TemplateCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplateCreateResponse]: + """Create Template + + Creates a template that can then be used. + + :param template_create_request: (required) + :type template_create_request: TemplateCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_create_serialize( + template_create_request=template_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_create_without_preload_content( + self, + template_create_request: TemplateCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Template + + Creates a template that can then be used. + + :param template_create_request: (required) + :type template_create_request: TemplateCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_create_serialize( + template_create_request=template_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_create_serialize( + self, + template_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = template_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if template_create_request is not None and has_files is False: + _body_params = template_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def template_create_embedded_draft( self, - template_create_embedded_draft_request, - **kwargs + template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TemplateCreateEmbeddedDraftResponse: - """Create Embedded Template Draft # noqa: E501 - - The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_create_embedded_draft(template_create_embedded_draft_request, async_req=True) - >>> result = thread.get() - - Args: - template_create_embedded_draft_request (TemplateCreateEmbeddedDraftRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateCreateEmbeddedDraftResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_create_embedded_draft_request'] = \ - template_create_embedded_draft_request - try: - return self.template_create_embedded_draft_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateCreateEmbeddedDraftResponse], - _check_type=True, + """Create Embedded Template Draft + + The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage. + + :param template_create_embedded_draft_request: (required) + :type template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_create_embedded_draft_serialize( + template_create_embedded_draft_request=template_create_embedded_draft_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateEmbeddedDraftResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_create_embedded_draft_with_http_info( + self, + template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplateCreateEmbeddedDraftResponse]: + """Create Embedded Template Draft + + The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage. + + :param template_create_embedded_draft_request: (required) + :type template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_create_embedded_draft_serialize( + template_create_embedded_draft_request=template_create_embedded_draft_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateEmbeddedDraftResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_create_embedded_draft_without_preload_content( + self, + template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Embedded Template Draft + + The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage. + + :param template_create_embedded_draft_request: (required) + :type template_create_embedded_draft_request: TemplateCreateEmbeddedDraftRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_create_embedded_draft_serialize( + template_create_embedded_draft_request=template_create_embedded_draft_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateCreateEmbeddedDraftResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_create_embedded_draft_serialize( + self, + template_create_embedded_draft_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = template_create_embedded_draft_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if template_create_embedded_draft_request is not None and has_files is False: + _body_params = template_create_embedded_draft_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/create_embedded_draft', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def template_delete( self, - template_id, - **kwargs + template_id: Annotated[StrictStr, Field(description="The id of the Template to delete.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete Template # noqa: E501 - - Completely deletes the template specified from the account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_delete(template_id, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the Template to delete. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - return self.template_delete_endpoint.call_with_http_info(**kwargs) + """Delete Template + + Completely deletes the template specified from the account. + + :param template_id: The id of the Template to delete. (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_delete_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_delete_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to delete.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Template + + Completely deletes the template specified from the account. + + :param template_id: The id of the Template to delete. (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_delete_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_delete_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to delete.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Template + + Completely deletes the template specified from the account. + + :param template_id: The id of the Template to delete. (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_delete_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_delete_serialize( + self, + template_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/delete/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def template_files( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> io.IOBase: + """Get Template Files + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_files_serialize( + template_id=template_id, + file_type=file_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "io.IOBase", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_files_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[io.IOBase]: + """Get Template Files + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_files_serialize( + template_id=template_id, + file_type=file_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "io.IOBase", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_files_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + file_type: Annotated[Optional[StrictStr], Field(description="Set to `pdf` for a single merged document or `zip` for a collection of individual documents.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Template Files + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param file_type: Set to `pdf` for a single merged document or `zip` for a collection of individual documents. + :type file_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_files_serialize( + template_id=template_id, + file_type=file_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "io.IOBase", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_files_serialize( self, template_id, - **kwargs - ) -> file_type: - """Get Template Files # noqa: E501 - - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_files(template_id, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the template files to retrieve. - - Keyword Args: - file_type (str): Set to `pdf` for a single merged document or `zip` for a collection of individual documents.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - try: - return self.template_files_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[file_type], - _check_type=True, - ) + file_type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + if file_type is not None: + + _query_params.append(('file_type', file_type)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/pdf', + 'application/zip', + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/template/files/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - raise e + + @validate_call def template_files_as_data_uri( self, - template_id, - **kwargs + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FileResponseDataUri: - """Get Template Files as Data Uri # noqa: E501 - - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_files_as_data_uri(template_id, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the template files to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - FileResponseDataUri - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - try: - return self.template_files_as_data_uri_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[FileResponseDataUri], - _check_type=True, - ) + """Get Template Files as Data Uri + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_files_as_data_uri_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_files_as_data_uri_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FileResponseDataUri]: + """Get Template Files as Data Uri + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_files_as_data_uri_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_files_as_data_uri_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Template Files as Data Uri + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_files_as_data_uri_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponseDataUri", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_files_as_data_uri_serialize( + self, + template_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/template/files_as_data_uri/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e + + + @validate_call def template_files_as_file_url( self, - template_id, - **kwargs + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FileResponse: - """Get Template Files as File Url # noqa: E501 - - Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_files_as_file_url(template_id, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the template files to retrieve. - - Keyword Args: - force_download (int): By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.. [optional] if omitted the server will use the default value of 1 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - FileResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - try: - return self.template_files_as_file_url_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[FileResponse], - _check_type=True, - ) + """Get Template Files as File Url + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_files_as_file_url_serialize( + template_id=template_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_files_as_file_url_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FileResponse]: + """Get Template Files as File Url + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_files_as_file_url_serialize( + template_id=template_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_files_as_file_url_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the template files to retrieve.")], + force_download: Annotated[Optional[StrictInt], Field(description="By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Template Files as File Url + + Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event. + + :param template_id: The id of the template files to retrieve. (required) + :type template_id: str + :param force_download: By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. + :type force_download: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_files_as_file_url_serialize( + template_id=template_id, + force_download=force_download, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FileResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_files_as_file_url_serialize( + self, + template_id, + force_download, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + if force_download is not None: + + _query_params.append(('force_download', force_download)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/template/files_as_file_url/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def template_get( self, - template_id, - **kwargs + template_id: Annotated[StrictStr, Field(description="The id of the Template to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TemplateGetResponse: - """Get Template # noqa: E501 - - Returns the Template specified by the `template_id` parameter. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_get(template_id, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the Template to retrieve. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - try: - return self.template_get_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateGetResponse], - _check_type=True, - ) + """Get Template + + Returns the Template specified by the `template_id` parameter. + + :param template_id: The id of the Template to retrieve. (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_get_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_get_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplateGetResponse]: + """Get Template + + Returns the Template specified by the `template_id` parameter. + + :param template_id: The id of the Template to retrieve. (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_get_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_get_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to retrieve.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Template + + Returns the Template specified by the `template_id` parameter. + + :param template_id: The id of the Template to retrieve. (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_get_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_get_serialize( + self, + template_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/template/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e + + + @validate_call def template_list( self, - **kwargs + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the Template List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the Template objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> TemplateListResponse: - """List Templates # noqa: E501 - - Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - account_id (str): Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.. [optional] - page (int): Which page number of the Template List to return. Defaults to `1`.. [optional] if omitted the server will use the default value of 1 - page_size (int): Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.. [optional] if omitted the server will use the default value of 20 - query (str): String that includes search terms and/or fields to be used to filter the Template objects.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - try: - return self.template_list_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateListResponse], - _check_type=True, - ) + """List Templates + + Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. + + :param account_id: Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the Template List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the Template objects. + :type query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_list_with_http_info( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the Template List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the Template objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplateListResponse]: + """List Templates + + Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. + + :param account_id: Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the Template List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the Template objects. + :type query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_list_without_preload_content( + self, + account_id: Annotated[Optional[StrictStr], Field(description="Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Which page number of the Template List to return. Defaults to `1`.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`.")] = None, + query: Annotated[Optional[StrictStr], Field(description="String that includes search terms and/or fields to be used to filter the Template objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Templates + + Returns a list of the Templates that are accessible by you. Take a look at our [search guide](/api/reference/search/) to learn more about querying templates. + + :param account_id: Which account to return Templates for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. + :type account_id: str + :param page: Which page number of the Template List to return. Defaults to `1`. + :type page: int + :param page_size: Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. + :type page_size: int + :param query: String that includes search terms and/or fields to be used to filter the Template objects. + :type query: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_list_serialize( + account_id=account_id, + page=page, + page_size=page_size, + query=query, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateListResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_list_serialize( + self, + account_id, + page, + page_size, + query, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if account_id is not None: + + _query_params.append(('account_id', account_id)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if query is not None: + + _query_params.append(('query', query)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/template/list', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + @validate_call def template_remove_user( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to remove the Account's access to.")], + template_remove_user_request: TemplateRemoveUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplateGetResponse: + """Remove User from Template + + Removes the specified Account's access to the specified Template. + + :param template_id: The id of the Template to remove the Account's access to. (required) + :type template_id: str + :param template_remove_user_request: (required) + :type template_remove_user_request: TemplateRemoveUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_remove_user_serialize( + template_id=template_id, + template_remove_user_request=template_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_remove_user_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to remove the Account's access to.")], + template_remove_user_request: TemplateRemoveUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplateGetResponse]: + """Remove User from Template + + Removes the specified Account's access to the specified Template. + + :param template_id: The id of the Template to remove the Account's access to. (required) + :type template_id: str + :param template_remove_user_request: (required) + :type template_remove_user_request: TemplateRemoveUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_remove_user_serialize( + template_id=template_id, + template_remove_user_request=template_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_remove_user_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The id of the Template to remove the Account's access to.")], + template_remove_user_request: TemplateRemoveUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove User from Template + + Removes the specified Account's access to the specified Template. + + :param template_id: The id of the Template to remove the Account's access to. (required) + :type template_id: str + :param template_remove_user_request: (required) + :type template_remove_user_request: TemplateRemoveUserRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_remove_user_serialize( + template_id=template_id, + template_remove_user_request=template_remove_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateGetResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_remove_user_serialize( self, template_id, template_remove_user_request, - **kwargs - ) -> TemplateGetResponse: - """Remove User from Template # noqa: E501 - - Removes the specified Account's access to the specified Template. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_remove_user(template_id, template_remove_user_request, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The id of the Template to remove the Account's access to. - template_remove_user_request (TemplateRemoveUserRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateGetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - kwargs['template_remove_user_request'] = \ - template_remove_user_request - try: - return self.template_remove_user_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateGetResponse], - _check_type=True, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = template_remove_user_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if template_remove_user_request is not None and has_files is False: + _body_params = template_remove_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/remove_user/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, - ) - raise e + + @validate_call def template_update_files( + self, + template_id: Annotated[StrictStr, Field(description="The ID of the template whose files to update.")], + template_update_files_request: TemplateUpdateFilesRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplateUpdateFilesResponse: + """Update Template Files + + Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). + + :param template_id: The ID of the template whose files to update. (required) + :type template_id: str + :param template_update_files_request: (required) + :type template_update_files_request: TemplateUpdateFilesRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_update_files_serialize( + template_id=template_id, + template_update_files_request=template_update_files_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateUpdateFilesResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def template_update_files_with_http_info( + self, + template_id: Annotated[StrictStr, Field(description="The ID of the template whose files to update.")], + template_update_files_request: TemplateUpdateFilesRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplateUpdateFilesResponse]: + """Update Template Files + + Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). + + :param template_id: The ID of the template whose files to update. (required) + :type template_id: str + :param template_update_files_request: (required) + :type template_update_files_request: TemplateUpdateFilesRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_update_files_serialize( + template_id=template_id, + template_update_files_request=template_update_files_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateUpdateFilesResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def template_update_files_without_preload_content( + self, + template_id: Annotated[StrictStr, Field(description="The ID of the template whose files to update.")], + template_update_files_request: TemplateUpdateFilesRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Template Files + + Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). + + :param template_id: The ID of the template whose files to update. (required) + :type template_id: str + :param template_update_files_request: (required) + :type template_update_files_request: TemplateUpdateFilesRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._template_update_files_serialize( + template_id=template_id, + template_update_files_request=template_update_files_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateUpdateFilesResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _template_update_files_serialize( self, template_id, template_update_files_request, - **kwargs - ) -> TemplateUpdateFilesResponse: - """Update Template Files # noqa: E501 - - Overlays a new file with the overlay of an existing template. The new file(s) must: 1. have the same or higher page count 2. the same orientation as the file(s) being replaced. This will not overwrite or in any way affect the existing template. Both the existing template and new template will be available for use after executing this endpoint. Also note that this will decrement your template quota. Overlaying new files is asynchronous and a successful call to this endpoint will return 200 OK response if the request passes initial validation checks. It is recommended that a callback be implemented to listen for the callback event. A `template_created` event will be sent when the files are updated or a `template_error` event will be sent if there was a problem while updating the files. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the API dashboard and retry the request if necessary. If the page orientation or page count is different from the original template document, we will notify you with a `template_error` [callback event](https://app.hellosign.com/api/eventsAndCallbacksWalkthrough). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.template_update_files(template_id, template_update_files_request, async_req=True) - >>> result = thread.get() - - Args: - template_id (str): The ID of the template whose files to update. - template_update_files_request (TemplateUpdateFilesRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TemplateUpdateFilesResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['template_id'] = \ - template_id - kwargs['template_update_files_request'] = \ - template_update_files_request - try: - return self.template_update_files_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[TemplateUpdateFilesResponse], - _check_type=True, - ) - - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") - - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = template_update_files_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if template_update_files_request is not None and has_files is False: + _body_params = template_update_files_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/template/update_files/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/dropbox_sign/api/unclaimed_draft_api.py b/dropbox_sign/api/unclaimed_draft_api.py index b66f301..24580c5 100644 --- a/dropbox_sign/api/unclaimed_draft_api.py +++ b/dropbox_sign/api/unclaimed_draft_api.py @@ -1,670 +1,1254 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from dropbox_sign.models.unclaimed_draft_create_embedded_request import UnclaimedDraftCreateEmbeddedRequest +from dropbox_sign.models.unclaimed_draft_create_embedded_with_template_request import UnclaimedDraftCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.unclaimed_draft_create_request import UnclaimedDraftCreateRequest +from dropbox_sign.models.unclaimed_draft_create_response import UnclaimedDraftCreateResponse +from dropbox_sign.models.unclaimed_draft_edit_and_resend_request import UnclaimedDraftEditAndResendRequest + +from dropbox_sign.api_client import ApiClient, RequestSerialized +from dropbox_sign.api_response import ApiResponse +from dropbox_sign.rest import RESTResponseType +import io -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from dropbox_sign.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.unclaimed_draft_create_embedded_request import UnclaimedDraftCreateEmbeddedRequest -from dropbox_sign.model.unclaimed_draft_create_embedded_with_template_request import UnclaimedDraftCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.unclaimed_draft_create_request import UnclaimedDraftCreateRequest -from dropbox_sign.model.unclaimed_draft_create_response import UnclaimedDraftCreateResponse -from dropbox_sign.model.unclaimed_draft_edit_and_resend_request import UnclaimedDraftEditAndResendRequest - - -class UnclaimedDraftApi(object): +class UnclaimedDraftApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.unclaimed_draft_create_endpoint = _Endpoint( - settings={ - 'response_type': (UnclaimedDraftCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/unclaimed_draft/create', - 'operation_id': 'unclaimed_draft_create', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'unclaimed_draft_create_request', - ], - 'required': [ - 'unclaimed_draft_create_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'unclaimed_draft_create_request': - (UnclaimedDraftCreateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'unclaimed_draft_create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.unclaimed_draft_create_embedded_endpoint = _Endpoint( - settings={ - 'response_type': (UnclaimedDraftCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/unclaimed_draft/create_embedded', - 'operation_id': 'unclaimed_draft_create_embedded', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'unclaimed_draft_create_embedded_request', - ], - 'required': [ - 'unclaimed_draft_create_embedded_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'unclaimed_draft_create_embedded_request': - (UnclaimedDraftCreateEmbeddedRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'unclaimed_draft_create_embedded_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.unclaimed_draft_create_embedded_with_template_endpoint = _Endpoint( - settings={ - 'response_type': (UnclaimedDraftCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/unclaimed_draft/create_embedded_with_template', - 'operation_id': 'unclaimed_draft_create_embedded_with_template', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'unclaimed_draft_create_embedded_with_template_request', - ], - 'required': [ - 'unclaimed_draft_create_embedded_with_template_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'unclaimed_draft_create_embedded_with_template_request': - (UnclaimedDraftCreateEmbeddedWithTemplateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'unclaimed_draft_create_embedded_with_template_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'multipart/form-data' - ] - }, - api_client=api_client - ) - self.unclaimed_draft_edit_and_resend_endpoint = _Endpoint( - settings={ - 'response_type': (UnclaimedDraftCreateResponse,), - 'auth': [ - 'api_key', - 'oauth2' - ], - 'endpoint_path': '/unclaimed_draft/edit_and_resend/{signature_request_id}', - 'operation_id': 'unclaimed_draft_edit_and_resend', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'signature_request_id', - 'unclaimed_draft_edit_and_resend_request', - ], - 'required': [ - 'signature_request_id', - 'unclaimed_draft_edit_and_resend_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'signature_request_id': - (str,), - 'unclaimed_draft_edit_and_resend_request': - (UnclaimedDraftEditAndResendRequest,), - }, - 'attribute_map': { - 'signature_request_id': 'signature_request_id', - }, - 'location_map': { - 'signature_request_id': 'path', - 'unclaimed_draft_edit_and_resend_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def unclaimed_draft_create( self, - unclaimed_draft_create_request, - **kwargs + unclaimed_draft_create_request: UnclaimedDraftCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UnclaimedDraftCreateResponse: - """Create Unclaimed Draft # noqa: E501 - - Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unclaimed_draft_create(unclaimed_draft_create_request, async_req=True) - >>> result = thread.get() - - Args: - unclaimed_draft_create_request (UnclaimedDraftCreateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - UnclaimedDraftCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['unclaimed_draft_create_request'] = \ - unclaimed_draft_create_request - try: - return self.unclaimed_draft_create_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[UnclaimedDraftCreateResponse], - _check_type=True, - ) + """Create Unclaimed Draft + + Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. + + :param unclaimed_draft_create_request: (required) + :type unclaimed_draft_create_request: UnclaimedDraftCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_create_serialize( + unclaimed_draft_create_request=unclaimed_draft_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def unclaimed_draft_create_with_http_info( + self, + unclaimed_draft_create_request: UnclaimedDraftCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UnclaimedDraftCreateResponse]: + """Create Unclaimed Draft + + Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. + + :param unclaimed_draft_create_request: (required) + :type unclaimed_draft_create_request: UnclaimedDraftCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_create_serialize( + unclaimed_draft_create_request=unclaimed_draft_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def unclaimed_draft_create_without_preload_content( + self, + unclaimed_draft_create_request: UnclaimedDraftCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Unclaimed Draft + + Creates a new Draft that can be claimed using the claim URL. The first authenticated user to access the URL will claim the Draft and will be shown either the \"Sign and send\" or the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a 404. + + :param unclaimed_draft_create_request: (required) + :type unclaimed_draft_create_request: UnclaimedDraftCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_create_serialize( + unclaimed_draft_create_request=unclaimed_draft_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unclaimed_draft_create_serialize( + self, + unclaimed_draft_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = unclaimed_draft_create_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if unclaimed_draft_create_request is not None and has_files is False: + _body_params = unclaimed_draft_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/unclaimed_draft/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + - raise e + @validate_call def unclaimed_draft_create_embedded( self, - unclaimed_draft_create_embedded_request, - **kwargs + unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UnclaimedDraftCreateResponse: - """Create Embedded Unclaimed Draft # noqa: E501 - - Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unclaimed_draft_create_embedded(unclaimed_draft_create_embedded_request, async_req=True) - >>> result = thread.get() - - Args: - unclaimed_draft_create_embedded_request (UnclaimedDraftCreateEmbeddedRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - UnclaimedDraftCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['unclaimed_draft_create_embedded_request'] = \ - unclaimed_draft_create_embedded_request - try: - return self.unclaimed_draft_create_embedded_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[UnclaimedDraftCreateResponse], - _check_type=True, - ) + """Create Embedded Unclaimed Draft + + Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_request: (required) + :type unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_create_embedded_serialize( + unclaimed_draft_create_embedded_request=unclaimed_draft_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def unclaimed_draft_create_embedded_with_http_info( + self, + unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UnclaimedDraftCreateResponse]: + """Create Embedded Unclaimed Draft + + Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_request: (required) + :type unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_create_embedded_serialize( + unclaimed_draft_create_embedded_request=unclaimed_draft_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def unclaimed_draft_create_embedded_without_preload_content( + self, + unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Embedded Unclaimed Draft + + Creates a new Draft that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_request: (required) + :type unclaimed_draft_create_embedded_request: UnclaimedDraftCreateEmbeddedRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_create_embedded_serialize( + unclaimed_draft_create_embedded_request=unclaimed_draft_create_embedded_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unclaimed_draft_create_embedded_serialize( + self, + unclaimed_draft_create_embedded_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = unclaimed_draft_create_embedded_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if unclaimed_draft_create_embedded_request is not None and has_files is False: + _body_params = unclaimed_draft_create_embedded_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - raise e + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + return self.api_client.param_serialize( + method='POST', + resource_path='/unclaimed_draft/create_embedded', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def unclaimed_draft_create_embedded_with_template( self, - unclaimed_draft_create_embedded_with_template_request, - **kwargs + unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UnclaimedDraftCreateResponse: - """Create Embedded Unclaimed Draft with Template # noqa: E501 - - Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unclaimed_draft_create_embedded_with_template(unclaimed_draft_create_embedded_with_template_request, async_req=True) - >>> result = thread.get() - - Args: - unclaimed_draft_create_embedded_with_template_request (UnclaimedDraftCreateEmbeddedWithTemplateRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - UnclaimedDraftCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['unclaimed_draft_create_embedded_with_template_request'] = \ - unclaimed_draft_create_embedded_with_template_request - try: - return self.unclaimed_draft_create_embedded_with_template_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[UnclaimedDraftCreateResponse], - _check_type=True, - ) + """Create Embedded Unclaimed Draft with Template + + Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_with_template_request: (required) + :type unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_create_embedded_with_template_serialize( + unclaimed_draft_create_embedded_with_template_request=unclaimed_draft_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def unclaimed_draft_create_embedded_with_template_with_http_info( + self, + unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UnclaimedDraftCreateResponse]: + """Create Embedded Unclaimed Draft with Template + + Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_with_template_request: (required) + :type unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_create_embedded_with_template_serialize( + unclaimed_draft_create_embedded_with_template_request=unclaimed_draft_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def unclaimed_draft_create_embedded_with_template_without_preload_content( + self, + unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Embedded Unclaimed Draft with Template + + Creates a new Draft with a previously saved template(s) that can be claimed and used in an embedded iFrame. The first authenticated user to access the URL will claim the Draft and will be shown the \"Request signature\" page with the Draft loaded. Subsequent access to the claim URL will result in a `404`. For this embedded endpoint the `requester_email_address` parameter is required. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param unclaimed_draft_create_embedded_with_template_request: (required) + :type unclaimed_draft_create_embedded_with_template_request: UnclaimedDraftCreateEmbeddedWithTemplateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_create_embedded_with_template_serialize( + unclaimed_draft_create_embedded_with_template_request=unclaimed_draft_create_embedded_with_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unclaimed_draft_create_embedded_with_template_serialize( + self, + unclaimed_draft_create_embedded_with_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = unclaimed_draft_create_embedded_with_template_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if unclaimed_draft_create_embedded_with_template_request is not None and has_files is False: + _body_params = unclaimed_draft_create_embedded_with_template_request + - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'multipart/form-data' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/unclaimed_draft/create_embedded_with_template', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + - raise e + @validate_call def unclaimed_draft_edit_and_resend( + self, + signature_request_id: Annotated[StrictStr, Field(description="The ID of the signature request to edit and resend.")], + unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UnclaimedDraftCreateResponse: + """Edit and Resend Unclaimed Draft + + Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param signature_request_id: The ID of the signature request to edit and resend. (required) + :type signature_request_id: str + :param unclaimed_draft_edit_and_resend_request: (required) + :type unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_edit_and_resend_serialize( + signature_request_id=signature_request_id, + unclaimed_draft_edit_and_resend_request=unclaimed_draft_edit_and_resend_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def unclaimed_draft_edit_and_resend_with_http_info( + self, + signature_request_id: Annotated[StrictStr, Field(description="The ID of the signature request to edit and resend.")], + unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UnclaimedDraftCreateResponse]: + """Edit and Resend Unclaimed Draft + + Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param signature_request_id: The ID of the signature request to edit and resend. (required) + :type signature_request_id: str + :param unclaimed_draft_edit_and_resend_request: (required) + :type unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_edit_and_resend_serialize( + signature_request_id=signature_request_id, + unclaimed_draft_edit_and_resend_request=unclaimed_draft_edit_and_resend_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def unclaimed_draft_edit_and_resend_without_preload_content( + self, + signature_request_id: Annotated[StrictStr, Field(description="The ID of the signature request to edit and resend.")], + unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Edit and Resend Unclaimed Draft + + Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. + + :param signature_request_id: The ID of the signature request to edit and resend. (required) + :type signature_request_id: str + :param unclaimed_draft_edit_and_resend_request: (required) + :type unclaimed_draft_edit_and_resend_request: UnclaimedDraftEditAndResendRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unclaimed_draft_edit_and_resend_serialize( + signature_request_id=signature_request_id, + unclaimed_draft_edit_and_resend_request=unclaimed_draft_edit_and_resend_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnclaimedDraftCreateResponse", + '4XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unclaimed_draft_edit_and_resend_serialize( self, signature_request_id, unclaimed_draft_edit_and_resend_request, - **kwargs - ) -> UnclaimedDraftCreateResponse: - """Edit and Resend Unclaimed Draft # noqa: E501 - - Creates a new signature request from an embedded request that can be edited prior to being sent to the recipients. Parameter `test_mode` can be edited prior to request. Signers can be edited in embedded editor. Requester's email address will remain unchanged if `requester_email_address` parameter is not set. **NOTE:** Embedded unclaimed drafts can only be accessed in embedded iFrames whereas normal drafts can be used and accessed on Dropbox Sign. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unclaimed_draft_edit_and_resend(signature_request_id, unclaimed_draft_edit_and_resend_request, async_req=True) - >>> result = thread.get() - - Args: - signature_request_id (str): The ID of the signature request to edit and resend. - unclaimed_draft_edit_and_resend_request (UnclaimedDraftEditAndResendRequest): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - UnclaimedDraftCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['signature_request_id'] = \ - signature_request_id - kwargs['unclaimed_draft_edit_and_resend_request'] = \ - unclaimed_draft_edit_and_resend_request - try: - return self.unclaimed_draft_edit_and_resend_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - if e.status == 200: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[UnclaimedDraftCreateResponse], - _check_type=True, - ) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - raise e - range_code = "4XX"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + _collection_formats: Dict[str, str] = { + } - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[ErrorResponse], - _check_type=True, + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + has_files = False + body_param = unclaimed_draft_edit_and_resend_request + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue + + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) + + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value + + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + # process the path parameters + if signature_request_id is not None: + _path_params['signature_request_id'] = signature_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if unclaimed_draft_edit_and_resend_request is not None and has_files is False: + _body_params = unclaimed_draft_edit_and_resend_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key', + 'oauth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/unclaimed_draft/edit_and_resend/{signature_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e diff --git a/dropbox_sign/api_client.py b/dropbox_sign/api_client.py index 67b3f08..e81ed63 100644 --- a/dropbox_sign/api_client.py +++ b/dropbox_sign/api_client.py @@ -1,46 +1,50 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal import json -import atexit import mimetypes -from multiprocessing.pool import ThreadPool -import io import os import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField +import tempfile +import io +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr -from dropbox_sign import rest from dropbox_sign.configuration import Configuration -from dropbox_sign.exceptions import ApiTypeError, ApiValueError, ApiException -from dropbox_sign.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types +from dropbox_sign.api_response import ApiResponse, T as ApiResponseT +import dropbox_sign.models +from dropbox_sign import rest +from dropbox_sign.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException ) +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] -class ApiClient(object): +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -48,28 +52,39 @@ class ApiClient(object): the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided if configuration is None: - configuration = Configuration.get_default_copy() + configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -77,31 +92,14 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.5.0/python' + self.user_agent = 'OpenAPI-Generator/1.6.0/python' + self.client_side_validation = configuration.client_side_validation def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -115,26 +113,69 @@ def user_agent(self, value): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - def __call_api( + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None - ): + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -145,14 +186,17 @@ def __call_api( header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -160,336 +204,269 @@ def __call_api( quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict) ) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) - # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead url = _host + resource_path + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + except ApiException as e: - e.body = e.body.decode('utf-8') raise e - self.last_response = response_data + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ - return_data = response_data + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg - if not _preload_content: - return (return_data) - return return_data + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None content_type = response_data.getheader('content-type') if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes + :param obj: The data to serialize. :return: The serialized form of data. """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() - } - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): return obj - elif isinstance(obj, (datetime, date)): + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item) for item in obj] - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) # fetch data from response object - try: - received_data = json.loads(response.data) - except TypeError: - received_data = response.data - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. + return self.__deserialize(data, response_type) - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(dropbox_sign.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) + return self.__deserialize_model(data, klass) def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -498,10 +475,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -521,396 +498,296 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): - """Builds form parameters. + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) """ - if files is None: - return [] + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) + else: + new_params.append((k, quote(str(v)))) + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters(self, files: Dict[str, Union[str, bytes, io.IOBase]]): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, io.IOBase): + filename = os.path.basename(v.name) + filedata = v.read() + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) + return accepts[0] - def select_header_content_type(self, content_types, method=None, body=None): + def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: - return 'application/json' + return None - content_types = [x.lower() for x in content_types] + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' + return content_types[0] - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body): + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting ) + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) + def __deserialize_file(self, response): + """Deserializes body to file - if kwargs['_check_input_type'] is False: - return + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - """We want to support a single typed object parameter for all endpoints, - including of multipart/form-data content-types. - """ - body = param_value.to_dict() - remove_files = [] - - for oas_name in param_value.openapi_types: - if hasattr(param_value, oas_name): - obj = param_value[oas_name] - if isinstance(obj, file_type): - params['file'][oas_name] = [obj] - remove_files.append(oas_name) - elif isinstance(obj, list): - i = 0 - for obj_value in obj: - if isinstance(obj_value, file_type): - key = oas_name + '[' + str(i) + ']' - params['file'][key] = [obj_value] - remove_files.append(oas_name) - i += 1 - - # remove duplicates - remove_files = list(set(remove_files)) - - for remove in remove_files: - body.pop(remove) - - if len(remove_files): - for param in body: - param_value_full = (param, body[param]) - - # do not change non-JSON values - if (not isinstance(body[param], (str, bool, int, float))): - param_value_full = (param, json.dumps(body[param])) - - params['form'].append(param_value_full) - else: - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][base_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format + with open(path, "wb") as f: + f.write(response.data) - return params + return path - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. - api_instance = AccountApi() - api_instance.account_create # this is an instance of the class Endpoint - api_instance.account_create() # this invokes api_instance.account_create.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.account_create.callable or self.callable in this class + :param data: str. + :param klass: class literal. + :return: int, long, float, str, bool. """ - return self.callable(self, *args, **kwargs) + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value - def call_with_http_info(self, **kwargs): + def __deserialize_date(self, string): + """Deserializes string to date. + :param string: str. + :return: date. + """ try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. - self.__validate_inputs(kwargs) + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) - params = self.__gather_params(kwargs) + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. - # Remove None values from query parameters - query_to_keep = [] - for key, value in params['query']: - if value is not None: - query_to_keep = query_to_keep + [(key, value)] + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) - params['query'] = query_to_keep + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if len(params['form']) > 0 or ('file' in params.keys() and len(params['file']) > 0): - params['header']['Content-Type'] = 'multipart/form-data' - elif params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - params['header']['Content-Type'] = header_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - collection_formats=params['collection_format']) + return klass.from_dict(data) diff --git a/dropbox_sign/api_response.py b/dropbox_sign/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/dropbox_sign/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/dropbox_sign/apis/__init__.py b/dropbox_sign/apis/__init__.py index dca24c9..16344f3 100644 --- a/dropbox_sign/apis/__init__.py +++ b/dropbox_sign/apis/__init__.py @@ -1,23 +1,11 @@ - # flake8: noqa -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from .api.account_api import AccountApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - # Import APIs into API package: from dropbox_sign.api.account_api import AccountApi from dropbox_sign.api.api_app_api import ApiAppApi from dropbox_sign.api.bulk_send_job_api import BulkSendJobApi from dropbox_sign.api.embedded_api import EmbeddedApi +from dropbox_sign.api.fax_line_api import FaxLineApi from dropbox_sign.api.o_auth_api import OAuthApi from dropbox_sign.api.report_api import ReportApi from dropbox_sign.api.signature_request_api import SignatureRequestApi diff --git a/dropbox_sign/configuration.py b/dropbox_sign/configuration.py index 7f8833e..d64e44b 100644 --- a/dropbox_sign/configuration.py +++ b/dropbox_sign/configuration.py @@ -1,23 +1,27 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import copy import logging +from logging import FileHandler import multiprocessing import sys +from typing import Optional import urllib3 -from http import client as http_client -from dropbox_sign.exceptions import ApiValueError - +import http.client as httplib JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -25,46 +29,23 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. +class Configuration: + """This class contains various settings of the API client. - :param host: Base url + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. :param server_index: Index to servers configuration. :param server_variables: Mapping with string values to replace variables in templated server configuration. The validation of enums is performed for @@ -73,9 +54,11 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format + in PEM format. + :param retries: Number of retries for API requests. :Example: @@ -90,8 +73,7 @@ class Configuration(object): Configure API client with HTTP basic authentication: conf = dropbox_sign.Configuration( - username='the-user', - password='the-password', + username='YOUR_API_KEY', ) """ @@ -100,14 +82,16 @@ class Configuration(object): def __init__(self, host=None, api_key=None, api_key_prefix=None, - access_token=None, username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", + access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, ssl_ca_cert=None, - ): + retries=None, + *, + debug: Optional[bool] = None + ) -> None: """Constructor """ self._base_path = "https://api.hellosign.com/v3" if host is None else host @@ -121,13 +105,15 @@ def __init__(self, host=None, self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ # Authentication Settings - self.access_token = access_token self.api_key = {} - if api_key: + if api_key and not username: self.api_key = api_key """dict to store API key(s) """ @@ -145,8 +131,9 @@ def __init__(self, host=None, self.password = password """Password for HTTP basic authentication """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations + self.access_token = access_token + """Access token + """ self.logger = {} """Logging Settings """ @@ -158,13 +145,16 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -185,6 +175,10 @@ def __init__(self, host=None, self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -194,26 +188,32 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ self.proxy_headers = None """Proxy headers """ self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation self.client_side_validation = True - # Options to pass down to the underlying urllib3 socket self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ def __deepcopy__(self, memo): cls = self.__class__ @@ -231,13 +231,6 @@ def __deepcopy__(self, memo): def __setattr__(self, name, value): object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s @classmethod def set_default(cls, default): @@ -248,21 +241,31 @@ def set_default(cls, default): :param default: object of Configuration """ - cls._default = copy.deepcopy(default) + cls._default = default @classmethod def get_default_copy(cls): - """Return new instance of configuration. + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default - configuration passed by the set_default method. + configuration. :return: The configuration object. """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() + if cls._default is None: + cls._default = Configuration() + return cls._default @property def logger_file(self): @@ -316,15 +319,15 @@ def debug(self, value): # if debug status is True, turn on debug logging for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 @property def logger_format(self): @@ -387,7 +390,7 @@ def auth_settings(self): :return: The Auth Settings information dict. """ auth = {} - if self.username is not None or self.password is not None: + if self.username is not None: auth['api_key'] = { 'type': 'basic', 'in': 'header', @@ -413,7 +416,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 3.0.0\n"\ - "SDK Package Version: 1.5.0".\ + "SDK Package Version: 1.6.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/dropbox_sign/exceptions.py b/dropbox_sign/exceptions.py index 460c01f..ba101a2 100644 --- a/dropbox_sign/exceptions.py +++ b/dropbox_sign/exceptions.py @@ -1,14 +1,20 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 +from typing import Any, Optional +from typing_extensions import Self +from dropbox_sign.models.error_response import ErrorResponse class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -16,7 +22,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -44,7 +50,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -62,7 +68,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -81,7 +87,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -99,17 +105,56 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data: ErrorResponse = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" @@ -119,34 +164,30 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message -class NotFoundException(ApiException): +class BadRequestException(ApiException): + pass - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) +class NotFoundException(ApiException): + pass -class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) +class UnauthorizedException(ApiException): + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) + pass def render_path(path_to_item): diff --git a/dropbox_sign/model/__init__.py b/dropbox_sign/model/__init__.py deleted file mode 100644 index cfe32b7..0000000 --- a/dropbox_sign/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB diff --git a/dropbox_sign/model/account_create_request.py b/dropbox_sign/model/account_create_request.py deleted file mode 100644 index f0cedb2..0000000 --- a/dropbox_sign/model/account_create_request.py +++ /dev/null @@ -1,325 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'client_secret': (str,), # noqa: E501 - 'locale': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'client_secret': 'client_secret', # noqa: E501 - 'locale': 'locale', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def client_secret(self) -> str: - return self.get("client_secret") - - @client_secret.setter - def client_secret(self, value: str): - setattr(self, "client_secret", value) - - @property - def locale(self) -> str: - return self.get("locale") - - @locale.setter - def locale(self, value: str): - setattr(self, "locale", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email_address, *args, **kwargs): # noqa: E501 - """AccountCreateRequest - a model defined in OpenAPI - - Args: - email_address (str): The email address which will be associated with the new Account. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client_id (str): Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization). [optional] # noqa: E501 - client_secret (str): Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization). [optional] # noqa: E501 - locale (str): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, email_address, *args, **kwargs): # noqa: E501 - """AccountCreateRequest - a model defined in OpenAPI - - Args: - email_address (str): The email address which will be associated with the new Account. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client_id (str): Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization). [optional] # noqa: E501 - client_secret (str): Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization). [optional] # noqa: E501 - locale (str): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/account_create_response.py b/dropbox_sign/model/account_create_response.py deleted file mode 100644 index f65c757..0000000 --- a/dropbox_sign/model/account_create_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.o_auth_token_response import OAuthTokenResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.o_auth_token_response import OAuthTokenResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['AccountResponse'] = AccountResponse - globals()['OAuthTokenResponse'] = OAuthTokenResponse - globals()['WarningResponse'] = WarningResponse - - -class AccountCreateResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'account': (AccountResponse,), # noqa: E501 - 'oauth_data': (OAuthTokenResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountCreateResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountCreateResponse], - _check_type=True, - ) - - attribute_map = { - 'account': 'account', # noqa: E501 - 'oauth_data': 'oauth_data', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account(self) -> AccountResponse: - return self.get("account") - - @account.setter - def account(self, value: AccountResponse): - setattr(self, "account", value) - - @property - def oauth_data(self) -> OAuthTokenResponse: - return self.get("oauth_data") - - @oauth_data.setter - def oauth_data(self, value: OAuthTokenResponse): - setattr(self, "oauth_data", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - oauth_data (OAuthTokenResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - oauth_data (OAuthTokenResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/account_get_response.py b/dropbox_sign/model/account_get_response.py deleted file mode 100644 index 93d494e..0000000 --- a/dropbox_sign/model/account_get_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['AccountResponse'] = AccountResponse - globals()['WarningResponse'] = WarningResponse - - -class AccountGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'account': (AccountResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountGetResponse], - _check_type=True, - ) - - attribute_map = { - 'account': 'account', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account(self) -> AccountResponse: - return self.get("account") - - @account.setter - def account(self, value: AccountResponse): - setattr(self, "account", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/account_response.py b/dropbox_sign/model/account_response.py deleted file mode 100644 index 3c35e63..0000000 --- a/dropbox_sign/model/account_response.py +++ /dev/null @@ -1,414 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_response_quotas import AccountResponseQuotas - from dropbox_sign.model.account_response_usage import AccountResponseUsage - - -def lazy_import(): - from dropbox_sign.model.account_response_quotas import AccountResponseQuotas - from dropbox_sign.model.account_response_usage import AccountResponseUsage - globals()['AccountResponseQuotas'] = AccountResponseQuotas - globals()['AccountResponseUsage'] = AccountResponseUsage - - -class AccountResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'is_locked': (bool,), # noqa: E501 - 'is_paid_hs': (bool,), # noqa: E501 - 'is_paid_hf': (bool,), # noqa: E501 - 'quotas': (AccountResponseQuotas,), # noqa: E501 - 'callback_url': (str, none_type,), # noqa: E501 - 'role_code': (str, none_type,), # noqa: E501 - 'team_id': (str, none_type,), # noqa: E501 - 'locale': (str, none_type,), # noqa: E501 - 'usage': (AccountResponseUsage,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountResponse], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'is_locked': 'is_locked', # noqa: E501 - 'is_paid_hs': 'is_paid_hs', # noqa: E501 - 'is_paid_hf': 'is_paid_hf', # noqa: E501 - 'quotas': 'quotas', # noqa: E501 - 'callback_url': 'callback_url', # noqa: E501 - 'role_code': 'role_code', # noqa: E501 - 'team_id': 'team_id', # noqa: E501 - 'locale': 'locale', # noqa: E501 - 'usage': 'usage', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def is_locked(self) -> bool: - return self.get("is_locked") - - @is_locked.setter - def is_locked(self, value: bool): - setattr(self, "is_locked", value) - - @property - def is_paid_hs(self) -> bool: - return self.get("is_paid_hs") - - @is_paid_hs.setter - def is_paid_hs(self, value: bool): - setattr(self, "is_paid_hs", value) - - @property - def is_paid_hf(self) -> bool: - return self.get("is_paid_hf") - - @is_paid_hf.setter - def is_paid_hf(self, value: bool): - setattr(self, "is_paid_hf", value) - - @property - def quotas(self) -> AccountResponseQuotas: - return self.get("quotas") - - @quotas.setter - def quotas(self, value: AccountResponseQuotas): - setattr(self, "quotas", value) - - @property - def callback_url(self) -> Optional[str]: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: Optional[str]): - setattr(self, "callback_url", value) - - @property - def role_code(self) -> Optional[str]: - return self.get("role_code") - - @role_code.setter - def role_code(self, value: Optional[str]): - setattr(self, "role_code", value) - - @property - def team_id(self) -> Optional[str]: - return self.get("team_id") - - @team_id.setter - def team_id(self, value: Optional[str]): - setattr(self, "team_id", value) - - @property - def locale(self) -> Optional[str]: - return self.get("locale") - - @locale.setter - def locale(self, value: Optional[str]): - setattr(self, "locale", value) - - @property - def usage(self) -> AccountResponseUsage: - return self.get("usage") - - @usage.setter - def usage(self, value: AccountResponseUsage): - setattr(self, "usage", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The ID of the Account. [optional] # noqa: E501 - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - is_locked (bool): Returns `true` if the user has been locked out of their account by a team admin.. [optional] # noqa: E501 - is_paid_hs (bool): Returns `true` if the user has a paid Dropbox Sign account.. [optional] # noqa: E501 - is_paid_hf (bool): Returns `true` if the user has a paid HelloFax account.. [optional] # noqa: E501 - quotas (AccountResponseQuotas): [optional] # noqa: E501 - callback_url (str, none_type): The URL that Dropbox Sign events will `POST` to.. [optional] # noqa: E501 - role_code (str, none_type): The membership role for the team.. [optional] # noqa: E501 - team_id (str, none_type): The id of the team account belongs to.. [optional] # noqa: E501 - locale (str, none_type): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - usage (AccountResponseUsage): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The ID of the Account. [optional] # noqa: E501 - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - is_locked (bool): Returns `true` if the user has been locked out of their account by a team admin.. [optional] # noqa: E501 - is_paid_hs (bool): Returns `true` if the user has a paid Dropbox Sign account.. [optional] # noqa: E501 - is_paid_hf (bool): Returns `true` if the user has a paid HelloFax account.. [optional] # noqa: E501 - quotas (AccountResponseQuotas): [optional] # noqa: E501 - callback_url (str, none_type): The URL that Dropbox Sign events will `POST` to.. [optional] # noqa: E501 - role_code (str, none_type): The membership role for the team.. [optional] # noqa: E501 - team_id (str, none_type): The id of the team account belongs to.. [optional] # noqa: E501 - locale (str, none_type): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - usage (AccountResponseUsage): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/account_response_quotas.py b/dropbox_sign/model/account_response_quotas.py deleted file mode 100644 index a38ffcc..0000000 --- a/dropbox_sign/model/account_response_quotas.py +++ /dev/null @@ -1,343 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountResponseQuotas(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'api_signature_requests_left': (int, none_type,), # noqa: E501 - 'documents_left': (int, none_type,), # noqa: E501 - 'templates_total': (int, none_type,), # noqa: E501 - 'templates_left': (int, none_type,), # noqa: E501 - 'sms_verifications_left': (int, none_type,), # noqa: E501 - 'num_fax_pages_left': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountResponseQuotas: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountResponseQuotas], - _check_type=True, - ) - - attribute_map = { - 'api_signature_requests_left': 'api_signature_requests_left', # noqa: E501 - 'documents_left': 'documents_left', # noqa: E501 - 'templates_total': 'templates_total', # noqa: E501 - 'templates_left': 'templates_left', # noqa: E501 - 'sms_verifications_left': 'sms_verifications_left', # noqa: E501 - 'num_fax_pages_left': 'num_fax_pages_left', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def api_signature_requests_left(self) -> Optional[int]: - return self.get("api_signature_requests_left") - - @api_signature_requests_left.setter - def api_signature_requests_left(self, value: Optional[int]): - setattr(self, "api_signature_requests_left", value) - - @property - def documents_left(self) -> Optional[int]: - return self.get("documents_left") - - @documents_left.setter - def documents_left(self, value: Optional[int]): - setattr(self, "documents_left", value) - - @property - def templates_total(self) -> Optional[int]: - return self.get("templates_total") - - @templates_total.setter - def templates_total(self, value: Optional[int]): - setattr(self, "templates_total", value) - - @property - def templates_left(self) -> Optional[int]: - return self.get("templates_left") - - @templates_left.setter - def templates_left(self, value: Optional[int]): - setattr(self, "templates_left", value) - - @property - def sms_verifications_left(self) -> Optional[int]: - return self.get("sms_verifications_left") - - @sms_verifications_left.setter - def sms_verifications_left(self, value: Optional[int]): - setattr(self, "sms_verifications_left", value) - - @property - def num_fax_pages_left(self) -> Optional[int]: - return self.get("num_fax_pages_left") - - @num_fax_pages_left.setter - def num_fax_pages_left(self, value: Optional[int]): - setattr(self, "num_fax_pages_left", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountResponseQuotas - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_signature_requests_left (int, none_type): API signature requests remaining.. [optional] # noqa: E501 - documents_left (int, none_type): Signature requests remaining.. [optional] # noqa: E501 - templates_total (int, none_type): Total API templates allowed.. [optional] # noqa: E501 - templates_left (int, none_type): API templates remaining.. [optional] # noqa: E501 - sms_verifications_left (int, none_type): SMS verifications remaining.. [optional] # noqa: E501 - num_fax_pages_left (int, none_type): Number of fax pages left. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountResponseQuotas - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_signature_requests_left (int, none_type): API signature requests remaining.. [optional] # noqa: E501 - documents_left (int, none_type): Signature requests remaining.. [optional] # noqa: E501 - templates_total (int, none_type): Total API templates allowed.. [optional] # noqa: E501 - templates_left (int, none_type): API templates remaining.. [optional] # noqa: E501 - sms_verifications_left (int, none_type): SMS verifications remaining.. [optional] # noqa: E501 - num_fax_pages_left (int, none_type): Number of fax pages left. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/account_response_usage.py b/dropbox_sign/model/account_response_usage.py deleted file mode 100644 index 8bdf363..0000000 --- a/dropbox_sign/model/account_response_usage.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountResponseUsage(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'fax_pages_sent': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountResponseUsage: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountResponseUsage], - _check_type=True, - ) - - attribute_map = { - 'fax_pages_sent': 'fax_pages_sent', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def fax_pages_sent(self) -> Optional[int]: - return self.get("fax_pages_sent") - - @fax_pages_sent.setter - def fax_pages_sent(self, value: Optional[int]): - setattr(self, "fax_pages_sent", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountResponseUsage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - fax_pages_sent (int, none_type): Number of fax pages sent. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountResponseUsage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - fax_pages_sent (int, none_type): Number of fax pages sent. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/account_update_request.py b/dropbox_sign/model/account_update_request.py deleted file mode 100644 index 3f7530d..0000000 --- a/dropbox_sign/model/account_update_request.py +++ /dev/null @@ -1,307 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountUpdateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str, none_type,), # noqa: E501 - 'callback_url': (str,), # noqa: E501 - 'locale': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountUpdateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountUpdateRequest], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'callback_url': 'callback_url', # noqa: E501 - 'locale': 'locale', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> Optional[str]: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: Optional[str]): - setattr(self, "account_id", value) - - @property - def callback_url(self) -> str: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: str): - setattr(self, "callback_url", value) - - @property - def locale(self) -> str: - return self.get("locale") - - @locale.setter - def locale(self, value: str): - setattr(self, "locale", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str, none_type): The ID of the Account. [optional] # noqa: E501 - callback_url (str): The URL that Dropbox Sign should POST events to.. [optional] # noqa: E501 - locale (str): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str, none_type): The ID of the Account. [optional] # noqa: E501 - callback_url (str): The URL that Dropbox Sign should POST events to.. [optional] # noqa: E501 - locale (str): The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/account_verify_request.py b/dropbox_sign/model/account_verify_request.py deleted file mode 100644 index 51b7dc9..0000000 --- a/dropbox_sign/model/account_verify_request.py +++ /dev/null @@ -1,289 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountVerifyRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountVerifyRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountVerifyRequest], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email_address, *args, **kwargs): # noqa: E501 - """AccountVerifyRequest - a model defined in OpenAPI - - Args: - email_address (str): Email address to run the verification for. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, email_address, *args, **kwargs): # noqa: E501 - """AccountVerifyRequest - a model defined in OpenAPI - - Args: - email_address (str): Email address to run the verification for. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/account_verify_response.py b/dropbox_sign/model/account_verify_response.py deleted file mode 100644 index 759ccaf..0000000 --- a/dropbox_sign/model/account_verify_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_verify_response_account import AccountVerifyResponseAccount - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.account_verify_response_account import AccountVerifyResponseAccount - from dropbox_sign.model.warning_response import WarningResponse - globals()['AccountVerifyResponseAccount'] = AccountVerifyResponseAccount - globals()['WarningResponse'] = WarningResponse - - -class AccountVerifyResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'account': (AccountVerifyResponseAccount,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountVerifyResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountVerifyResponse], - _check_type=True, - ) - - attribute_map = { - 'account': 'account', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account(self) -> AccountVerifyResponseAccount: - return self.get("account") - - @account.setter - def account(self, value: AccountVerifyResponseAccount): - setattr(self, "account", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountVerifyResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountVerifyResponseAccount): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountVerifyResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountVerifyResponseAccount): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/account_verify_response_account.py b/dropbox_sign/model/account_verify_response_account.py deleted file mode 100644 index ab275f4..0000000 --- a/dropbox_sign/model/account_verify_response_account.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class AccountVerifyResponseAccount(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> AccountVerifyResponseAccount: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[AccountVerifyResponseAccount], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """AccountVerifyResponseAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """AccountVerifyResponseAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/api_app_create_request.py b/dropbox_sign/model/api_app_create_request.py deleted file mode 100644 index e9f887a..0000000 --- a/dropbox_sign/model/api_app_create_request.py +++ /dev/null @@ -1,381 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_o_auth import SubOAuth - from dropbox_sign.model.sub_options import SubOptions - from dropbox_sign.model.sub_white_labeling_options import SubWhiteLabelingOptions - - -def lazy_import(): - from dropbox_sign.model.sub_o_auth import SubOAuth - from dropbox_sign.model.sub_options import SubOptions - from dropbox_sign.model.sub_white_labeling_options import SubWhiteLabelingOptions - globals()['SubOAuth'] = SubOAuth - globals()['SubOptions'] = SubOptions - globals()['SubWhiteLabelingOptions'] = SubWhiteLabelingOptions - - -class ApiAppCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('domains',): { - 'max_items': 2, - 'min_items': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'domains': ([str],), # noqa: E501 - 'name': (str,), # noqa: E501 - 'callback_url': (str,), # noqa: E501 - 'custom_logo_file': (file_type,), # noqa: E501 - 'oauth': (SubOAuth,), # noqa: E501 - 'options': (SubOptions,), # noqa: E501 - 'white_labeling_options': (SubWhiteLabelingOptions,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'domains': 'domains', # noqa: E501 - 'name': 'name', # noqa: E501 - 'callback_url': 'callback_url', # noqa: E501 - 'custom_logo_file': 'custom_logo_file', # noqa: E501 - 'oauth': 'oauth', # noqa: E501 - 'options': 'options', # noqa: E501 - 'white_labeling_options': 'white_labeling_options', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def domains(self) -> List[str]: - return self.get("domains") - - @domains.setter - def domains(self, value: List[str]): - setattr(self, "domains", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def callback_url(self) -> str: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: str): - setattr(self, "callback_url", value) - - @property - def custom_logo_file(self) -> file_type: - return self.get("custom_logo_file") - - @custom_logo_file.setter - def custom_logo_file(self, value: file_type): - setattr(self, "custom_logo_file", value) - - @property - def oauth(self) -> SubOAuth: - return self.get("oauth") - - @oauth.setter - def oauth(self, value: SubOAuth): - setattr(self, "oauth", value) - - @property - def options(self) -> SubOptions: - return self.get("options") - - @options.setter - def options(self, value: SubOptions): - setattr(self, "options", value) - - @property - def white_labeling_options(self) -> SubWhiteLabelingOptions: - return self.get("white_labeling_options") - - @white_labeling_options.setter - def white_labeling_options(self, value: SubWhiteLabelingOptions): - setattr(self, "white_labeling_options", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, domains, name, *args, **kwargs): # noqa: E501 - """ApiAppCreateRequest - a model defined in OpenAPI - - Args: - domains ([str]): The domain names the ApiApp will be associated with. - name (str): The name you want to assign to the ApiApp. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The URL at which the ApiApp should receive event callbacks.. [optional] # noqa: E501 - custom_logo_file (file_type): An image file to use as a custom logo in embedded contexts. (Only applies to some API plans). [optional] # noqa: E501 - oauth (SubOAuth): [optional] # noqa: E501 - options (SubOptions): [optional] # noqa: E501 - white_labeling_options (SubWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.domains = domains - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, domains, name, *args, **kwargs): # noqa: E501 - """ApiAppCreateRequest - a model defined in OpenAPI - - Args: - domains ([str]): The domain names the ApiApp will be associated with. - name (str): The name you want to assign to the ApiApp. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The URL at which the ApiApp should receive event callbacks.. [optional] # noqa: E501 - custom_logo_file (file_type): An image file to use as a custom logo in embedded contexts. (Only applies to some API plans). [optional] # noqa: E501 - oauth (SubOAuth): [optional] # noqa: E501 - options (SubOptions): [optional] # noqa: E501 - white_labeling_options (SubWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.domains = domains - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/api_app_get_response.py b/dropbox_sign/model/api_app_get_response.py deleted file mode 100644 index 306458f..0000000 --- a/dropbox_sign/model/api_app_get_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.api_app_response import ApiAppResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.api_app_response import ApiAppResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ApiAppResponse'] = ApiAppResponse - globals()['WarningResponse'] = WarningResponse - - -class ApiAppGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'api_app': (ApiAppResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppGetResponse], - _check_type=True, - ) - - attribute_map = { - 'api_app': 'api_app', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def api_app(self) -> ApiAppResponse: - return self.get("api_app") - - @api_app.setter - def api_app(self, value: ApiAppResponse): - setattr(self, "api_app", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_app (ApiAppResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_app (ApiAppResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/api_app_list_response.py b/dropbox_sign/model/api_app_list_response.py deleted file mode 100644 index e3d49ab..0000000 --- a/dropbox_sign/model/api_app_list_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.api_app_response import ApiAppResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.api_app_response import ApiAppResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ApiAppResponse'] = ApiAppResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['WarningResponse'] = WarningResponse - - -class ApiAppListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'api_apps': ([ApiAppResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppListResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppListResponse], - _check_type=True, - ) - - attribute_map = { - 'api_apps': 'api_apps', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def api_apps(self) -> List[ApiAppResponse]: - return self.get("api_apps") - - @api_apps.setter - def api_apps(self, value: List[ApiAppResponse]): - setattr(self, "api_apps", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_apps ([ApiAppResponse]): Contains information about API Apps.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_apps ([ApiAppResponse]): Contains information about API Apps.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/api_app_response.py b/dropbox_sign/model/api_app_response.py deleted file mode 100644 index e9b610d..0000000 --- a/dropbox_sign/model/api_app_response.py +++ /dev/null @@ -1,408 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.api_app_response_o_auth import ApiAppResponseOAuth - from dropbox_sign.model.api_app_response_options import ApiAppResponseOptions - from dropbox_sign.model.api_app_response_owner_account import ApiAppResponseOwnerAccount - from dropbox_sign.model.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions - - -def lazy_import(): - from dropbox_sign.model.api_app_response_o_auth import ApiAppResponseOAuth - from dropbox_sign.model.api_app_response_options import ApiAppResponseOptions - from dropbox_sign.model.api_app_response_owner_account import ApiAppResponseOwnerAccount - from dropbox_sign.model.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions - globals()['ApiAppResponseOAuth'] = ApiAppResponseOAuth - globals()['ApiAppResponseOptions'] = ApiAppResponseOptions - globals()['ApiAppResponseOwnerAccount'] = ApiAppResponseOwnerAccount - globals()['ApiAppResponseWhiteLabelingOptions'] = ApiAppResponseWhiteLabelingOptions - - -class ApiAppResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'callback_url': (str, none_type,), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'created_at': (int,), # noqa: E501 - 'domains': ([str],), # noqa: E501 - 'name': (str,), # noqa: E501 - 'is_approved': (bool,), # noqa: E501 - 'oauth': (ApiAppResponseOAuth,), # noqa: E501 - 'options': (ApiAppResponseOptions,), # noqa: E501 - 'owner_account': (ApiAppResponseOwnerAccount,), # noqa: E501 - 'white_labeling_options': (ApiAppResponseWhiteLabelingOptions,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppResponse], - _check_type=True, - ) - - attribute_map = { - 'callback_url': 'callback_url', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'created_at': 'created_at', # noqa: E501 - 'domains': 'domains', # noqa: E501 - 'name': 'name', # noqa: E501 - 'is_approved': 'is_approved', # noqa: E501 - 'oauth': 'oauth', # noqa: E501 - 'options': 'options', # noqa: E501 - 'owner_account': 'owner_account', # noqa: E501 - 'white_labeling_options': 'white_labeling_options', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def callback_url(self) -> Optional[str]: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: Optional[str]): - setattr(self, "callback_url", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def created_at(self) -> int: - return self.get("created_at") - - @created_at.setter - def created_at(self, value: int): - setattr(self, "created_at", value) - - @property - def domains(self) -> List[str]: - return self.get("domains") - - @domains.setter - def domains(self, value: List[str]): - setattr(self, "domains", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def is_approved(self) -> bool: - return self.get("is_approved") - - @is_approved.setter - def is_approved(self, value: bool): - setattr(self, "is_approved", value) - - @property - def oauth(self) -> ApiAppResponseOAuth: - return self.get("oauth") - - @oauth.setter - def oauth(self, value: ApiAppResponseOAuth): - setattr(self, "oauth", value) - - @property - def options(self) -> ApiAppResponseOptions: - return self.get("options") - - @options.setter - def options(self, value: ApiAppResponseOptions): - setattr(self, "options", value) - - @property - def owner_account(self) -> ApiAppResponseOwnerAccount: - return self.get("owner_account") - - @owner_account.setter - def owner_account(self, value: ApiAppResponseOwnerAccount): - setattr(self, "owner_account", value) - - @property - def white_labeling_options(self) -> ApiAppResponseWhiteLabelingOptions: - return self.get("white_labeling_options") - - @white_labeling_options.setter - def white_labeling_options(self, value: ApiAppResponseWhiteLabelingOptions): - setattr(self, "white_labeling_options", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str, none_type): The app's callback URL (for events). [optional] # noqa: E501 - client_id (str): The app's client id. [optional] # noqa: E501 - created_at (int): The time that the app was created. [optional] # noqa: E501 - domains ([str]): The domain name(s) associated with the app. [optional] # noqa: E501 - name (str): The name of the app. [optional] # noqa: E501 - is_approved (bool): Boolean to indicate if the app has been approved. [optional] # noqa: E501 - oauth (ApiAppResponseOAuth): [optional] # noqa: E501 - options (ApiAppResponseOptions): [optional] # noqa: E501 - owner_account (ApiAppResponseOwnerAccount): [optional] # noqa: E501 - white_labeling_options (ApiAppResponseWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str, none_type): The app's callback URL (for events). [optional] # noqa: E501 - client_id (str): The app's client id. [optional] # noqa: E501 - created_at (int): The time that the app was created. [optional] # noqa: E501 - domains ([str]): The domain name(s) associated with the app. [optional] # noqa: E501 - name (str): The name of the app. [optional] # noqa: E501 - is_approved (bool): Boolean to indicate if the app has been approved. [optional] # noqa: E501 - oauth (ApiAppResponseOAuth): [optional] # noqa: E501 - options (ApiAppResponseOptions): [optional] # noqa: E501 - owner_account (ApiAppResponseOwnerAccount): [optional] # noqa: E501 - white_labeling_options (ApiAppResponseWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/api_app_response_o_auth.py b/dropbox_sign/model/api_app_response_o_auth.py deleted file mode 100644 index 9453dcb..0000000 --- a/dropbox_sign/model/api_app_response_o_auth.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ApiAppResponseOAuth(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'callback_url': (str,), # noqa: E501 - 'secret': (str,), # noqa: E501 - 'scopes': ([str],), # noqa: E501 - 'charges_users': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppResponseOAuth: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppResponseOAuth], - _check_type=True, - ) - - attribute_map = { - 'callback_url': 'callback_url', # noqa: E501 - 'secret': 'secret', # noqa: E501 - 'scopes': 'scopes', # noqa: E501 - 'charges_users': 'charges_users', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def callback_url(self) -> str: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: str): - setattr(self, "callback_url", value) - - @property - def secret(self) -> str: - return self.get("secret") - - @secret.setter - def secret(self, value: str): - setattr(self, "secret", value) - - @property - def scopes(self) -> List[str]: - return self.get("scopes") - - @scopes.setter - def scopes(self, value: List[str]): - setattr(self, "scopes", value) - - @property - def charges_users(self) -> bool: - return self.get("charges_users") - - @charges_users.setter - def charges_users(self, value: bool): - setattr(self, "charges_users", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppResponseOAuth - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The app's OAuth callback URL.. [optional] # noqa: E501 - secret (str): The app's OAuth secret, or null if the app does not belong to user.. [optional] # noqa: E501 - scopes ([str]): Array of OAuth scopes used by the app.. [optional] # noqa: E501 - charges_users (bool): Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppResponseOAuth - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The app's OAuth callback URL.. [optional] # noqa: E501 - secret (str): The app's OAuth secret, or null if the app does not belong to user.. [optional] # noqa: E501 - scopes ([str]): Array of OAuth scopes used by the app.. [optional] # noqa: E501 - charges_users (bool): Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/api_app_response_options.py b/dropbox_sign/model/api_app_response_options.py deleted file mode 100644 index ab43904..0000000 --- a/dropbox_sign/model/api_app_response_options.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ApiAppResponseOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'can_insert_everywhere': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppResponseOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppResponseOptions], - _check_type=True, - ) - - attribute_map = { - 'can_insert_everywhere': 'can_insert_everywhere', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def can_insert_everywhere(self) -> bool: - return self.get("can_insert_everywhere") - - @can_insert_everywhere.setter - def can_insert_everywhere(self, value: bool): - setattr(self, "can_insert_everywhere", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppResponseOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - can_insert_everywhere (bool): Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppResponseOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - can_insert_everywhere (bool): Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/api_app_response_owner_account.py b/dropbox_sign/model/api_app_response_owner_account.py deleted file mode 100644 index 519ec0c..0000000 --- a/dropbox_sign/model/api_app_response_owner_account.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ApiAppResponseOwnerAccount(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppResponseOwnerAccount: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppResponseOwnerAccount], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppResponseOwnerAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The owner account's ID. [optional] # noqa: E501 - email_address (str): The owner account's email address. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppResponseOwnerAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The owner account's ID. [optional] # noqa: E501 - email_address (str): The owner account's email address. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/api_app_response_white_labeling_options.py b/dropbox_sign/model/api_app_response_white_labeling_options.py deleted file mode 100644 index 61a6f1b..0000000 --- a/dropbox_sign/model/api_app_response_white_labeling_options.py +++ /dev/null @@ -1,439 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ApiAppResponseWhiteLabelingOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'header_background_color': (str,), # noqa: E501 - 'legal_version': (str,), # noqa: E501 - 'link_color': (str,), # noqa: E501 - 'page_background_color': (str,), # noqa: E501 - 'primary_button_color': (str,), # noqa: E501 - 'primary_button_color_hover': (str,), # noqa: E501 - 'primary_button_text_color': (str,), # noqa: E501 - 'primary_button_text_color_hover': (str,), # noqa: E501 - 'secondary_button_color': (str,), # noqa: E501 - 'secondary_button_color_hover': (str,), # noqa: E501 - 'secondary_button_text_color': (str,), # noqa: E501 - 'secondary_button_text_color_hover': (str,), # noqa: E501 - 'text_color1': (str,), # noqa: E501 - 'text_color2': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppResponseWhiteLabelingOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppResponseWhiteLabelingOptions], - _check_type=True, - ) - - attribute_map = { - 'header_background_color': 'header_background_color', # noqa: E501 - 'legal_version': 'legal_version', # noqa: E501 - 'link_color': 'link_color', # noqa: E501 - 'page_background_color': 'page_background_color', # noqa: E501 - 'primary_button_color': 'primary_button_color', # noqa: E501 - 'primary_button_color_hover': 'primary_button_color_hover', # noqa: E501 - 'primary_button_text_color': 'primary_button_text_color', # noqa: E501 - 'primary_button_text_color_hover': 'primary_button_text_color_hover', # noqa: E501 - 'secondary_button_color': 'secondary_button_color', # noqa: E501 - 'secondary_button_color_hover': 'secondary_button_color_hover', # noqa: E501 - 'secondary_button_text_color': 'secondary_button_text_color', # noqa: E501 - 'secondary_button_text_color_hover': 'secondary_button_text_color_hover', # noqa: E501 - 'text_color1': 'text_color1', # noqa: E501 - 'text_color2': 'text_color2', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def header_background_color(self) -> str: - return self.get("header_background_color") - - @header_background_color.setter - def header_background_color(self, value: str): - setattr(self, "header_background_color", value) - - @property - def legal_version(self) -> str: - return self.get("legal_version") - - @legal_version.setter - def legal_version(self, value: str): - setattr(self, "legal_version", value) - - @property - def link_color(self) -> str: - return self.get("link_color") - - @link_color.setter - def link_color(self, value: str): - setattr(self, "link_color", value) - - @property - def page_background_color(self) -> str: - return self.get("page_background_color") - - @page_background_color.setter - def page_background_color(self, value: str): - setattr(self, "page_background_color", value) - - @property - def primary_button_color(self) -> str: - return self.get("primary_button_color") - - @primary_button_color.setter - def primary_button_color(self, value: str): - setattr(self, "primary_button_color", value) - - @property - def primary_button_color_hover(self) -> str: - return self.get("primary_button_color_hover") - - @primary_button_color_hover.setter - def primary_button_color_hover(self, value: str): - setattr(self, "primary_button_color_hover", value) - - @property - def primary_button_text_color(self) -> str: - return self.get("primary_button_text_color") - - @primary_button_text_color.setter - def primary_button_text_color(self, value: str): - setattr(self, "primary_button_text_color", value) - - @property - def primary_button_text_color_hover(self) -> str: - return self.get("primary_button_text_color_hover") - - @primary_button_text_color_hover.setter - def primary_button_text_color_hover(self, value: str): - setattr(self, "primary_button_text_color_hover", value) - - @property - def secondary_button_color(self) -> str: - return self.get("secondary_button_color") - - @secondary_button_color.setter - def secondary_button_color(self, value: str): - setattr(self, "secondary_button_color", value) - - @property - def secondary_button_color_hover(self) -> str: - return self.get("secondary_button_color_hover") - - @secondary_button_color_hover.setter - def secondary_button_color_hover(self, value: str): - setattr(self, "secondary_button_color_hover", value) - - @property - def secondary_button_text_color(self) -> str: - return self.get("secondary_button_text_color") - - @secondary_button_text_color.setter - def secondary_button_text_color(self, value: str): - setattr(self, "secondary_button_text_color", value) - - @property - def secondary_button_text_color_hover(self) -> str: - return self.get("secondary_button_text_color_hover") - - @secondary_button_text_color_hover.setter - def secondary_button_text_color_hover(self, value: str): - setattr(self, "secondary_button_text_color_hover", value) - - @property - def text_color1(self) -> str: - return self.get("text_color1") - - @text_color1.setter - def text_color1(self, value: str): - setattr(self, "text_color1", value) - - @property - def text_color2(self) -> str: - return self.get("text_color2") - - @text_color2.setter - def text_color2(self, value: str): - setattr(self, "text_color2", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppResponseWhiteLabelingOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - header_background_color (str): [optional] # noqa: E501 - legal_version (str): [optional] # noqa: E501 - link_color (str): [optional] # noqa: E501 - page_background_color (str): [optional] # noqa: E501 - primary_button_color (str): [optional] # noqa: E501 - primary_button_color_hover (str): [optional] # noqa: E501 - primary_button_text_color (str): [optional] # noqa: E501 - primary_button_text_color_hover (str): [optional] # noqa: E501 - secondary_button_color (str): [optional] # noqa: E501 - secondary_button_color_hover (str): [optional] # noqa: E501 - secondary_button_text_color (str): [optional] # noqa: E501 - secondary_button_text_color_hover (str): [optional] # noqa: E501 - text_color1 (str): [optional] # noqa: E501 - text_color2 (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppResponseWhiteLabelingOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - header_background_color (str): [optional] # noqa: E501 - legal_version (str): [optional] # noqa: E501 - link_color (str): [optional] # noqa: E501 - page_background_color (str): [optional] # noqa: E501 - primary_button_color (str): [optional] # noqa: E501 - primary_button_color_hover (str): [optional] # noqa: E501 - primary_button_text_color (str): [optional] # noqa: E501 - primary_button_text_color_hover (str): [optional] # noqa: E501 - secondary_button_color (str): [optional] # noqa: E501 - secondary_button_color_hover (str): [optional] # noqa: E501 - secondary_button_text_color (str): [optional] # noqa: E501 - secondary_button_text_color_hover (str): [optional] # noqa: E501 - text_color1 (str): [optional] # noqa: E501 - text_color2 (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/api_app_update_request.py b/dropbox_sign/model/api_app_update_request.py deleted file mode 100644 index 87885b3..0000000 --- a/dropbox_sign/model/api_app_update_request.py +++ /dev/null @@ -1,372 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_o_auth import SubOAuth - from dropbox_sign.model.sub_options import SubOptions - from dropbox_sign.model.sub_white_labeling_options import SubWhiteLabelingOptions - - -def lazy_import(): - from dropbox_sign.model.sub_o_auth import SubOAuth - from dropbox_sign.model.sub_options import SubOptions - from dropbox_sign.model.sub_white_labeling_options import SubWhiteLabelingOptions - globals()['SubOAuth'] = SubOAuth - globals()['SubOptions'] = SubOptions - globals()['SubWhiteLabelingOptions'] = SubWhiteLabelingOptions - - -class ApiAppUpdateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('domains',): { - 'max_items': 2, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'callback_url': (str,), # noqa: E501 - 'custom_logo_file': (file_type,), # noqa: E501 - 'domains': ([str],), # noqa: E501 - 'name': (str,), # noqa: E501 - 'oauth': (SubOAuth,), # noqa: E501 - 'options': (SubOptions,), # noqa: E501 - 'white_labeling_options': (SubWhiteLabelingOptions,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ApiAppUpdateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ApiAppUpdateRequest], - _check_type=True, - ) - - attribute_map = { - 'callback_url': 'callback_url', # noqa: E501 - 'custom_logo_file': 'custom_logo_file', # noqa: E501 - 'domains': 'domains', # noqa: E501 - 'name': 'name', # noqa: E501 - 'oauth': 'oauth', # noqa: E501 - 'options': 'options', # noqa: E501 - 'white_labeling_options': 'white_labeling_options', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def callback_url(self) -> str: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: str): - setattr(self, "callback_url", value) - - @property - def custom_logo_file(self) -> file_type: - return self.get("custom_logo_file") - - @custom_logo_file.setter - def custom_logo_file(self, value: file_type): - setattr(self, "custom_logo_file", value) - - @property - def domains(self) -> List[str]: - return self.get("domains") - - @domains.setter - def domains(self, value: List[str]): - setattr(self, "domains", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def oauth(self) -> SubOAuth: - return self.get("oauth") - - @oauth.setter - def oauth(self, value: SubOAuth): - setattr(self, "oauth", value) - - @property - def options(self) -> SubOptions: - return self.get("options") - - @options.setter - def options(self, value: SubOptions): - setattr(self, "options", value) - - @property - def white_labeling_options(self) -> SubWhiteLabelingOptions: - return self.get("white_labeling_options") - - @white_labeling_options.setter - def white_labeling_options(self, value: SubWhiteLabelingOptions): - setattr(self, "white_labeling_options", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ApiAppUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The URL at which the API App should receive event callbacks.. [optional] # noqa: E501 - custom_logo_file (file_type): An image file to use as a custom logo in embedded contexts. (Only applies to some API plans). [optional] # noqa: E501 - domains ([str]): The domain names the ApiApp will be associated with.. [optional] # noqa: E501 - name (str): The name you want to assign to the ApiApp.. [optional] # noqa: E501 - oauth (SubOAuth): [optional] # noqa: E501 - options (SubOptions): [optional] # noqa: E501 - white_labeling_options (SubWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ApiAppUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The URL at which the API App should receive event callbacks.. [optional] # noqa: E501 - custom_logo_file (file_type): An image file to use as a custom logo in embedded contexts. (Only applies to some API plans). [optional] # noqa: E501 - domains ([str]): The domain names the ApiApp will be associated with.. [optional] # noqa: E501 - name (str): The name you want to assign to the ApiApp.. [optional] # noqa: E501 - oauth (SubOAuth): [optional] # noqa: E501 - options (SubOptions): [optional] # noqa: E501 - white_labeling_options (SubWhiteLabelingOptions): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/bulk_send_job_get_response.py b/dropbox_sign/model/bulk_send_job_get_response.py deleted file mode 100644 index 3fce46b..0000000 --- a/dropbox_sign/model/bulk_send_job_get_response.py +++ /dev/null @@ -1,336 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['BulkSendJobGetResponseSignatureRequests'] = BulkSendJobGetResponseSignatureRequests - globals()['BulkSendJobResponse'] = BulkSendJobResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['WarningResponse'] = WarningResponse - - -class BulkSendJobGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'bulk_send_job': (BulkSendJobResponse,), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'signature_requests': ([BulkSendJobGetResponseSignatureRequests],), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> BulkSendJobGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[BulkSendJobGetResponse], - _check_type=True, - ) - - attribute_map = { - 'bulk_send_job': 'bulk_send_job', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'signature_requests': 'signature_requests', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def bulk_send_job(self) -> BulkSendJobResponse: - return self.get("bulk_send_job") - - @bulk_send_job.setter - def bulk_send_job(self, value: BulkSendJobResponse): - setattr(self, "bulk_send_job", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def signature_requests(self) -> List[BulkSendJobGetResponseSignatureRequests]: - return self.get("signature_requests") - - @signature_requests.setter - def signature_requests(self, value: List[BulkSendJobGetResponseSignatureRequests]): - setattr(self, "signature_requests", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BulkSendJobGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job (BulkSendJobResponse): [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - signature_requests ([BulkSendJobGetResponseSignatureRequests]): Contains information about the Signature Requests sent in bulk.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BulkSendJobGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job (BulkSendJobResponse): [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - signature_requests ([BulkSendJobGetResponseSignatureRequests]): Contains information about the Signature Requests sent in bulk.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/bulk_send_job_get_response_signature_requests.py b/dropbox_sign/model/bulk_send_job_get_response_signature_requests.py deleted file mode 100644 index b9963bb..0000000 --- a/dropbox_sign/model/bulk_send_job_get_response_signature_requests.py +++ /dev/null @@ -1,639 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.signature_request_response_attachment import SignatureRequestResponseAttachment - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - from dropbox_sign.model.signature_request_response_signatures import SignatureRequestResponseSignatures - - -def lazy_import(): - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.signature_request_response_attachment import SignatureRequestResponseAttachment - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - from dropbox_sign.model.signature_request_response_signatures import SignatureRequestResponseSignatures - globals()['SignatureRequestResponse'] = SignatureRequestResponse - globals()['SignatureRequestResponseAttachment'] = SignatureRequestResponseAttachment - globals()['SignatureRequestResponseCustomFieldBase'] = SignatureRequestResponseCustomFieldBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - globals()['SignatureRequestResponseSignatures'] = SignatureRequestResponseSignatures - - -class BulkSendJobGetResponseSignatureRequests(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'test_mode': (bool, none_type,), # noqa: E501 - 'signature_request_id': (str,), # noqa: E501 - 'requester_email_address': (str,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'original_title': (str,), # noqa: E501 - 'subject': (str, none_type,), # noqa: E501 - 'message': (str, none_type,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'created_at': (int,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - 'is_complete': (bool,), # noqa: E501 - 'is_declined': (bool,), # noqa: E501 - 'has_error': (bool,), # noqa: E501 - 'files_url': (str,), # noqa: E501 - 'signing_url': (str, none_type,), # noqa: E501 - 'details_url': (str,), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'signing_redirect_url': (str, none_type,), # noqa: E501 - 'final_copy_uri': (str, none_type,), # noqa: E501 - 'template_ids': ([str], none_type,), # noqa: E501 - 'custom_fields': ([SignatureRequestResponseCustomFieldBase], none_type,), # noqa: E501 - 'attachments': ([SignatureRequestResponseAttachment], none_type,), # noqa: E501 - 'response_data': ([SignatureRequestResponseDataBase], none_type,), # noqa: E501 - 'signatures': ([SignatureRequestResponseSignatures],), # noqa: E501 - 'bulk_send_job_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> BulkSendJobGetResponseSignatureRequests: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[BulkSendJobGetResponseSignatureRequests], - _check_type=True, - ) - - - attribute_map = { - 'test_mode': 'test_mode', # noqa: E501 - 'signature_request_id': 'signature_request_id', # noqa: E501 - 'requester_email_address': 'requester_email_address', # noqa: E501 - 'title': 'title', # noqa: E501 - 'original_title': 'original_title', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'created_at': 'created_at', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - 'is_complete': 'is_complete', # noqa: E501 - 'is_declined': 'is_declined', # noqa: E501 - 'has_error': 'has_error', # noqa: E501 - 'files_url': 'files_url', # noqa: E501 - 'signing_url': 'signing_url', # noqa: E501 - 'details_url': 'details_url', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'final_copy_uri': 'final_copy_uri', # noqa: E501 - 'template_ids': 'template_ids', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'response_data': 'response_data', # noqa: E501 - 'signatures': 'signatures', # noqa: E501 - 'bulk_send_job_id': 'bulk_send_job_id', # noqa: E501 - } - - read_only_vars = { - } - - @property - def test_mode(self) -> Optional[bool]: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: Optional[bool]): - setattr(self, "test_mode", value) - - @property - def signature_request_id(self) -> str: - return self.get("signature_request_id") - - @signature_request_id.setter - def signature_request_id(self, value: str): - setattr(self, "signature_request_id", value) - - @property - def requester_email_address(self) -> str: - return self.get("requester_email_address") - - @requester_email_address.setter - def requester_email_address(self, value: str): - setattr(self, "requester_email_address", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def original_title(self) -> str: - return self.get("original_title") - - @original_title.setter - def original_title(self, value: str): - setattr(self, "original_title", value) - - @property - def subject(self) -> Optional[str]: - return self.get("subject") - - @subject.setter - def subject(self, value: Optional[str]): - setattr(self, "subject", value) - - @property - def message(self) -> Optional[str]: - return self.get("message") - - @message.setter - def message(self, value: Optional[str]): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def created_at(self) -> int: - return self.get("created_at") - - @created_at.setter - def created_at(self, value: int): - setattr(self, "created_at", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @property - def is_complete(self) -> bool: - return self.get("is_complete") - - @is_complete.setter - def is_complete(self, value: bool): - setattr(self, "is_complete", value) - - @property - def is_declined(self) -> bool: - return self.get("is_declined") - - @is_declined.setter - def is_declined(self, value: bool): - setattr(self, "is_declined", value) - - @property - def has_error(self) -> bool: - return self.get("has_error") - - @has_error.setter - def has_error(self, value: bool): - setattr(self, "has_error", value) - - @property - def files_url(self) -> str: - return self.get("files_url") - - @files_url.setter - def files_url(self, value: str): - setattr(self, "files_url", value) - - @property - def signing_url(self) -> Optional[str]: - return self.get("signing_url") - - @signing_url.setter - def signing_url(self, value: Optional[str]): - setattr(self, "signing_url", value) - - @property - def details_url(self) -> str: - return self.get("details_url") - - @details_url.setter - def details_url(self, value: str): - setattr(self, "details_url", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def signing_redirect_url(self) -> Optional[str]: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: Optional[str]): - setattr(self, "signing_redirect_url", value) - - @property - def final_copy_uri(self) -> Optional[str]: - return self.get("final_copy_uri") - - @final_copy_uri.setter - def final_copy_uri(self, value: Optional[str]): - setattr(self, "final_copy_uri", value) - - @property - def template_ids(self) -> Optional[List[str]]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: Optional[List[str]]): - setattr(self, "template_ids", value) - - @property - def custom_fields(self) -> Optional[List[SignatureRequestResponseCustomFieldBase]]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: Optional[List[SignatureRequestResponseCustomFieldBase]]): - setattr(self, "custom_fields", value) - - @property - def attachments(self) -> Optional[List[SignatureRequestResponseAttachment]]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: Optional[List[SignatureRequestResponseAttachment]]): - setattr(self, "attachments", value) - - @property - def response_data(self) -> Optional[List[SignatureRequestResponseDataBase]]: - return self.get("response_data") - - @response_data.setter - def response_data(self, value: Optional[List[SignatureRequestResponseDataBase]]): - setattr(self, "response_data", value) - - @property - def signatures(self) -> List[SignatureRequestResponseSignatures]: - return self.get("signatures") - - @signatures.setter - def signatures(self, value: List[SignatureRequestResponseSignatures]): - setattr(self, "signatures", value) - - @property - def bulk_send_job_id(self) -> str: - return self.get("bulk_send_job_id") - - @bulk_send_job_id.setter - def bulk_send_job_id(self, value: str): - setattr(self, "bulk_send_job_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BulkSendJobGetResponseSignatureRequests - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - test_mode (bool, none_type): Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - signature_request_id (str): The id of the SignatureRequest.. [optional] # noqa: E501 - requester_email_address (str): The email address of the initiator of the SignatureRequest.. [optional] # noqa: E501 - title (str): The title the specified Account uses for the SignatureRequest.. [optional] # noqa: E501 - original_title (str): Default Label for account.. [optional] # noqa: E501 - subject (str, none_type): The subject in the email that was initially sent to the signers.. [optional] # noqa: E501 - message (str, none_type): The custom message in the email that was initially sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the signature request.. [optional] # noqa: E501 - created_at (int): Time the signature request was created.. [optional] # noqa: E501 - expires_at (int): The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - is_complete (bool): Whether or not the SignatureRequest has been fully executed by all signers.. [optional] # noqa: E501 - is_declined (bool): Whether or not the SignatureRequest has been declined by a signer.. [optional] # noqa: E501 - has_error (bool): Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).. [optional] # noqa: E501 - files_url (str): The URL where a copy of the request's documents can be downloaded.. [optional] # noqa: E501 - signing_url (str, none_type): The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.. [optional] # noqa: E501 - details_url (str): The URL where the requester and the signers can view the current status of the SignatureRequest.. [optional] # noqa: E501 - cc_email_addresses ([str]): A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want the signer redirected to after they successfully sign.. [optional] # noqa: E501 - final_copy_uri (str, none_type): The path where the completed document can be downloaded. [optional] # noqa: E501 - template_ids ([str], none_type): Templates IDs used in this SignatureRequest (if any).. [optional] # noqa: E501 - custom_fields ([SignatureRequestResponseCustomFieldBase], none_type): An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`. [optional] # noqa: E501 - attachments ([SignatureRequestResponseAttachment], none_type): Signer attachments.. [optional] # noqa: E501 - response_data ([SignatureRequestResponseDataBase], none_type): An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.. [optional] # noqa: E501 - signatures ([SignatureRequestResponseSignatures]): An array of signature objects, 1 for each signer.. [optional] # noqa: E501 - bulk_send_job_id (str): The id of the BulkSendJob.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BulkSendJobGetResponseSignatureRequests - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - test_mode (bool, none_type): Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - signature_request_id (str): The id of the SignatureRequest.. [optional] # noqa: E501 - requester_email_address (str): The email address of the initiator of the SignatureRequest.. [optional] # noqa: E501 - title (str): The title the specified Account uses for the SignatureRequest.. [optional] # noqa: E501 - original_title (str): Default Label for account.. [optional] # noqa: E501 - subject (str, none_type): The subject in the email that was initially sent to the signers.. [optional] # noqa: E501 - message (str, none_type): The custom message in the email that was initially sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the signature request.. [optional] # noqa: E501 - created_at (int): Time the signature request was created.. [optional] # noqa: E501 - expires_at (int): The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - is_complete (bool): Whether or not the SignatureRequest has been fully executed by all signers.. [optional] # noqa: E501 - is_declined (bool): Whether or not the SignatureRequest has been declined by a signer.. [optional] # noqa: E501 - has_error (bool): Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).. [optional] # noqa: E501 - files_url (str): The URL where a copy of the request's documents can be downloaded.. [optional] # noqa: E501 - signing_url (str, none_type): The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.. [optional] # noqa: E501 - details_url (str): The URL where the requester and the signers can view the current status of the SignatureRequest.. [optional] # noqa: E501 - cc_email_addresses ([str]): A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want the signer redirected to after they successfully sign.. [optional] # noqa: E501 - final_copy_uri (str, none_type): The path where the completed document can be downloaded. [optional] # noqa: E501 - template_ids ([str], none_type): Templates IDs used in this SignatureRequest (if any).. [optional] # noqa: E501 - custom_fields ([SignatureRequestResponseCustomFieldBase], none_type): An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`. [optional] # noqa: E501 - attachments ([SignatureRequestResponseAttachment], none_type): Signer attachments.. [optional] # noqa: E501 - response_data ([SignatureRequestResponseDataBase], none_type): An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.. [optional] # noqa: E501 - signatures ([SignatureRequestResponseSignatures]): An array of signature objects, 1 for each signer.. [optional] # noqa: E501 - bulk_send_job_id (str): The id of the BulkSendJob.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/bulk_send_job_list_response.py b/dropbox_sign/model/bulk_send_job_list_response.py deleted file mode 100644 index b2b54d5..0000000 --- a/dropbox_sign/model/bulk_send_job_list_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['BulkSendJobResponse'] = BulkSendJobResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['WarningResponse'] = WarningResponse - - -class BulkSendJobListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'bulk_send_jobs': ([BulkSendJobResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> BulkSendJobListResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[BulkSendJobListResponse], - _check_type=True, - ) - - attribute_map = { - 'bulk_send_jobs': 'bulk_send_jobs', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def bulk_send_jobs(self) -> List[BulkSendJobResponse]: - return self.get("bulk_send_jobs") - - @bulk_send_jobs.setter - def bulk_send_jobs(self, value: List[BulkSendJobResponse]): - setattr(self, "bulk_send_jobs", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BulkSendJobListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_jobs ([BulkSendJobResponse]): Contains a list of BulkSendJobs that the API caller has access to.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BulkSendJobListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_jobs ([BulkSendJobResponse]): Contains a list of BulkSendJobs that the API caller has access to.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/bulk_send_job_response.py b/dropbox_sign/model/bulk_send_job_response.py deleted file mode 100644 index a2f7066..0000000 --- a/dropbox_sign/model/bulk_send_job_response.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class BulkSendJobResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bulk_send_job_id': (str, none_type,), # noqa: E501 - 'total': (int,), # noqa: E501 - 'is_creator': (bool,), # noqa: E501 - 'created_at': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> BulkSendJobResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[BulkSendJobResponse], - _check_type=True, - ) - - attribute_map = { - 'bulk_send_job_id': 'bulk_send_job_id', # noqa: E501 - 'total': 'total', # noqa: E501 - 'is_creator': 'is_creator', # noqa: E501 - 'created_at': 'created_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def bulk_send_job_id(self) -> Optional[str]: - return self.get("bulk_send_job_id") - - @bulk_send_job_id.setter - def bulk_send_job_id(self, value: Optional[str]): - setattr(self, "bulk_send_job_id", value) - - @property - def total(self) -> int: - return self.get("total") - - @total.setter - def total(self, value: int): - setattr(self, "total", value) - - @property - def is_creator(self) -> bool: - return self.get("is_creator") - - @is_creator.setter - def is_creator(self, value: bool): - setattr(self, "is_creator", value) - - @property - def created_at(self) -> int: - return self.get("created_at") - - @created_at.setter - def created_at(self, value: int): - setattr(self, "created_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BulkSendJobResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job_id (str, none_type): The id of the BulkSendJob.. [optional] # noqa: E501 - total (int): The total amount of Signature Requests queued for sending.. [optional] # noqa: E501 - is_creator (bool): True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member.. [optional] # noqa: E501 - created_at (int): Time that the BulkSendJob was created.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BulkSendJobResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job_id (str, none_type): The id of the BulkSendJob.. [optional] # noqa: E501 - total (int): The total amount of Signature Requests queued for sending.. [optional] # noqa: E501 - is_creator (bool): True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member.. [optional] # noqa: E501 - created_at (int): Time that the BulkSendJob was created.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/bulk_send_job_send_response.py b/dropbox_sign/model/bulk_send_job_send_response.py deleted file mode 100644 index c605e04..0000000 --- a/dropbox_sign/model/bulk_send_job_send_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['BulkSendJobResponse'] = BulkSendJobResponse - globals()['WarningResponse'] = WarningResponse - - -class BulkSendJobSendResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'bulk_send_job': (BulkSendJobResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> BulkSendJobSendResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[BulkSendJobSendResponse], - _check_type=True, - ) - - attribute_map = { - 'bulk_send_job': 'bulk_send_job', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def bulk_send_job(self) -> BulkSendJobResponse: - return self.get("bulk_send_job") - - @bulk_send_job.setter - def bulk_send_job(self, value: BulkSendJobResponse): - setattr(self, "bulk_send_job", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """BulkSendJobSendResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job (BulkSendJobResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """BulkSendJobSendResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bulk_send_job (BulkSendJobResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/embedded_edit_url_request.py b/dropbox_sign/model/embedded_edit_url_request.py deleted file mode 100644 index b1544ed..0000000 --- a/dropbox_sign/model/embedded_edit_url_request.py +++ /dev/null @@ -1,402 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_merge_field import SubMergeField - - -def lazy_import(): - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_merge_field import SubMergeField - globals()['SubEditorOptions'] = SubEditorOptions - globals()['SubMergeField'] = SubMergeField - - -class EmbeddedEditUrlRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'allow_edit_ccs': (bool,), # noqa: E501 - 'cc_roles': ([str],), # noqa: E501 - 'editor_options': (SubEditorOptions,), # noqa: E501 - 'force_signer_roles': (bool,), # noqa: E501 - 'force_subject_message': (bool,), # noqa: E501 - 'merge_fields': ([SubMergeField],), # noqa: E501 - 'preview_only': (bool,), # noqa: E501 - 'show_preview': (bool,), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EmbeddedEditUrlRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EmbeddedEditUrlRequest], - _check_type=True, - ) - - attribute_map = { - 'allow_edit_ccs': 'allow_edit_ccs', # noqa: E501 - 'cc_roles': 'cc_roles', # noqa: E501 - 'editor_options': 'editor_options', # noqa: E501 - 'force_signer_roles': 'force_signer_roles', # noqa: E501 - 'force_subject_message': 'force_subject_message', # noqa: E501 - 'merge_fields': 'merge_fields', # noqa: E501 - 'preview_only': 'preview_only', # noqa: E501 - 'show_preview': 'show_preview', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def allow_edit_ccs(self) -> bool: - return self.get("allow_edit_ccs") - - @allow_edit_ccs.setter - def allow_edit_ccs(self, value: bool): - setattr(self, "allow_edit_ccs", value) - - @property - def cc_roles(self) -> List[str]: - return self.get("cc_roles") - - @cc_roles.setter - def cc_roles(self, value: List[str]): - setattr(self, "cc_roles", value) - - @property - def editor_options(self) -> SubEditorOptions: - return self.get("editor_options") - - @editor_options.setter - def editor_options(self, value: SubEditorOptions): - setattr(self, "editor_options", value) - - @property - def force_signer_roles(self) -> bool: - return self.get("force_signer_roles") - - @force_signer_roles.setter - def force_signer_roles(self, value: bool): - setattr(self, "force_signer_roles", value) - - @property - def force_subject_message(self) -> bool: - return self.get("force_subject_message") - - @force_subject_message.setter - def force_subject_message(self, value: bool): - setattr(self, "force_subject_message", value) - - @property - def merge_fields(self) -> List[SubMergeField]: - return self.get("merge_fields") - - @merge_fields.setter - def merge_fields(self, value: List[SubMergeField]): - setattr(self, "merge_fields", value) - - @property - def preview_only(self) -> bool: - return self.get("preview_only") - - @preview_only.setter - def preview_only(self, value: bool): - setattr(self, "preview_only", value) - - @property - def show_preview(self) -> bool: - return self.get("show_preview") - - @show_preview.setter - def show_preview(self, value: bool): - setattr(self, "show_preview", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_edit_ccs (bool): This allows the requester to enable/disable to add or change CC roles when editing the template.. [optional] if omitted the server will use the default value of False # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - merge_fields ([SubMergeField]): Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`.. [optional] # noqa: E501 - preview_only (bool): This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set).. [optional] if omitted the server will use the default value of False # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - test_mode (bool): Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_edit_ccs (bool): This allows the requester to enable/disable to add or change CC roles when editing the template.. [optional] if omitted the server will use the default value of False # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - merge_fields ([SubMergeField]): Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`.. [optional] # noqa: E501 - preview_only (bool): This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set).. [optional] if omitted the server will use the default value of False # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - test_mode (bool): Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/embedded_edit_url_response.py b/dropbox_sign/model/embedded_edit_url_response.py deleted file mode 100644 index 963f7a3..0000000 --- a/dropbox_sign/model/embedded_edit_url_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded - from dropbox_sign.model.warning_response import WarningResponse - globals()['EmbeddedEditUrlResponseEmbedded'] = EmbeddedEditUrlResponseEmbedded - globals()['WarningResponse'] = WarningResponse - - -class EmbeddedEditUrlResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'embedded': (EmbeddedEditUrlResponseEmbedded,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EmbeddedEditUrlResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EmbeddedEditUrlResponse], - _check_type=True, - ) - - attribute_map = { - 'embedded': 'embedded', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def embedded(self) -> EmbeddedEditUrlResponseEmbedded: - return self.get("embedded") - - @embedded.setter - def embedded(self, value: EmbeddedEditUrlResponseEmbedded): - setattr(self, "embedded", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - embedded (EmbeddedEditUrlResponseEmbedded): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - embedded (EmbeddedEditUrlResponseEmbedded): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/embedded_edit_url_response_embedded.py b/dropbox_sign/model/embedded_edit_url_response_embedded.py deleted file mode 100644 index c2cf267..0000000 --- a/dropbox_sign/model/embedded_edit_url_response_embedded.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class EmbeddedEditUrlResponseEmbedded(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'edit_url': (str,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EmbeddedEditUrlResponseEmbedded: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EmbeddedEditUrlResponseEmbedded], - _check_type=True, - ) - - attribute_map = { - 'edit_url': 'edit_url', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def edit_url(self) -> str: - return self.get("edit_url") - - @edit_url.setter - def edit_url(self, value: str): - setattr(self, "edit_url", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlResponseEmbedded - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - edit_url (str): A template url that can be opened in an iFrame.. [optional] # noqa: E501 - expires_at (int): The specific time that the the `edit_url` link expires, in epoch.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddedEditUrlResponseEmbedded - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - edit_url (str): A template url that can be opened in an iFrame.. [optional] # noqa: E501 - expires_at (int): The specific time that the the `edit_url` link expires, in epoch.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/embedded_sign_url_response.py b/dropbox_sign/model/embedded_sign_url_response.py deleted file mode 100644 index 0166f99..0000000 --- a/dropbox_sign/model/embedded_sign_url_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded - from dropbox_sign.model.warning_response import WarningResponse - globals()['EmbeddedSignUrlResponseEmbedded'] = EmbeddedSignUrlResponseEmbedded - globals()['WarningResponse'] = WarningResponse - - -class EmbeddedSignUrlResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'embedded': (EmbeddedSignUrlResponseEmbedded,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EmbeddedSignUrlResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EmbeddedSignUrlResponse], - _check_type=True, - ) - - attribute_map = { - 'embedded': 'embedded', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def embedded(self) -> EmbeddedSignUrlResponseEmbedded: - return self.get("embedded") - - @embedded.setter - def embedded(self, value: EmbeddedSignUrlResponseEmbedded): - setattr(self, "embedded", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddedSignUrlResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - embedded (EmbeddedSignUrlResponseEmbedded): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddedSignUrlResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - embedded (EmbeddedSignUrlResponseEmbedded): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/embedded_sign_url_response_embedded.py b/dropbox_sign/model/embedded_sign_url_response_embedded.py deleted file mode 100644 index 22ae691..0000000 --- a/dropbox_sign/model/embedded_sign_url_response_embedded.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class EmbeddedSignUrlResponseEmbedded(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'sign_url': (str,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EmbeddedSignUrlResponseEmbedded: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EmbeddedSignUrlResponseEmbedded], - _check_type=True, - ) - - attribute_map = { - 'sign_url': 'sign_url', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def sign_url(self) -> str: - return self.get("sign_url") - - @sign_url.setter - def sign_url(self, value: str): - setattr(self, "sign_url", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EmbeddedSignUrlResponseEmbedded - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sign_url (str): A signature url that can be opened in an iFrame.. [optional] # noqa: E501 - expires_at (int): The specific time that the the `sign_url` link expires, in epoch.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EmbeddedSignUrlResponseEmbedded - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sign_url (str): A signature url that can be opened in an iFrame.. [optional] # noqa: E501 - expires_at (int): The specific time that the the `sign_url` link expires, in epoch.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/error_response.py b/dropbox_sign/model/error_response.py deleted file mode 100644 index 981ce0c..0000000 --- a/dropbox_sign/model/error_response.py +++ /dev/null @@ -1,297 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.error_response_error import ErrorResponseError - - -def lazy_import(): - from dropbox_sign.model.error_response_error import ErrorResponseError - globals()['ErrorResponseError'] = ErrorResponseError - - -class ErrorResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'error': (ErrorResponseError,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ErrorResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ErrorResponse], - _check_type=True, - ) - - attribute_map = { - 'error': 'error', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def error(self) -> ErrorResponseError: - return self.get("error") - - @error.setter - def error(self, value: ErrorResponseError): - setattr(self, "error", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, error, *args, **kwargs): # noqa: E501 - """ErrorResponse - a model defined in OpenAPI - - Args: - error (ErrorResponseError): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.error = error - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, error, *args, **kwargs): # noqa: E501 - """ErrorResponse - a model defined in OpenAPI - - Args: - error (ErrorResponseError): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.error = error - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/error_response_error.py b/dropbox_sign/model/error_response_error.py deleted file mode 100644 index b710192..0000000 --- a/dropbox_sign/model/error_response_error.py +++ /dev/null @@ -1,315 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ErrorResponseError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'error_msg': (str,), # noqa: E501 - 'error_name': (str,), # noqa: E501 - 'error_path': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ErrorResponseError: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ErrorResponseError], - _check_type=True, - ) - - attribute_map = { - 'error_msg': 'error_msg', # noqa: E501 - 'error_name': 'error_name', # noqa: E501 - 'error_path': 'error_path', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def error_msg(self) -> str: - return self.get("error_msg") - - @error_msg.setter - def error_msg(self, value: str): - setattr(self, "error_msg", value) - - @property - def error_name(self) -> str: - return self.get("error_name") - - @error_name.setter - def error_name(self, value: str): - setattr(self, "error_name", value) - - @property - def error_path(self) -> str: - return self.get("error_path") - - @error_path.setter - def error_path(self, value: str): - setattr(self, "error_path", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, error_msg, error_name, *args, **kwargs): # noqa: E501 - """ErrorResponseError - a model defined in OpenAPI - - Args: - error_msg (str): Message describing an error. - error_name (str): Name of the error. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - error_path (str): Path at which an error occurred.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.error_msg = error_msg - self.error_name = error_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, error_msg, error_name, *args, **kwargs): # noqa: E501 - """ErrorResponseError - a model defined in OpenAPI - - Args: - error_msg (str): Message describing an error. - error_name (str): Name of the error. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - error_path (str): Path at which an error occurred.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.error_msg = error_msg - self.error_name = error_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/event_callback_request.py b/dropbox_sign/model/event_callback_request.py deleted file mode 100644 index 24f455f..0000000 --- a/dropbox_sign/model/event_callback_request.py +++ /dev/null @@ -1,342 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.event_callback_request_event import EventCallbackRequestEvent - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.template_response import TemplateResponse - - -def lazy_import(): - from dropbox_sign.model.account_response import AccountResponse - from dropbox_sign.model.event_callback_request_event import EventCallbackRequestEvent - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.template_response import TemplateResponse - globals()['AccountResponse'] = AccountResponse - globals()['EventCallbackRequestEvent'] = EventCallbackRequestEvent - globals()['SignatureRequestResponse'] = SignatureRequestResponse - globals()['TemplateResponse'] = TemplateResponse - - -class EventCallbackRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event': (EventCallbackRequestEvent,), # noqa: E501 - 'account': (AccountResponse,), # noqa: E501 - 'signature_request': (SignatureRequestResponse,), # noqa: E501 - 'template': (TemplateResponse,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EventCallbackRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EventCallbackRequest], - _check_type=True, - ) - - attribute_map = { - 'event': 'event', # noqa: E501 - 'account': 'account', # noqa: E501 - 'signature_request': 'signature_request', # noqa: E501 - 'template': 'template', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def event(self) -> EventCallbackRequestEvent: - return self.get("event") - - @event.setter - def event(self, value: EventCallbackRequestEvent): - setattr(self, "event", value) - - @property - def account(self) -> AccountResponse: - return self.get("account") - - @account.setter - def account(self, value: AccountResponse): - setattr(self, "account", value) - - @property - def signature_request(self) -> SignatureRequestResponse: - return self.get("signature_request") - - @signature_request.setter - def signature_request(self, value: SignatureRequestResponse): - setattr(self, "signature_request", value) - - @property - def template(self) -> TemplateResponse: - return self.get("template") - - @template.setter - def template(self, value: TemplateResponse): - setattr(self, "template", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, event, *args, **kwargs): # noqa: E501 - """EventCallbackRequest - a model defined in OpenAPI - - Args: - event (EventCallbackRequestEvent): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - signature_request (SignatureRequestResponse): [optional] # noqa: E501 - template (TemplateResponse): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.event = event - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, event, *args, **kwargs): # noqa: E501 - """EventCallbackRequest - a model defined in OpenAPI - - Args: - event (EventCallbackRequestEvent): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account (AccountResponse): [optional] # noqa: E501 - signature_request (SignatureRequestResponse): [optional] # noqa: E501 - template (TemplateResponse): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.event = event - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/event_callback_request_event.py b/dropbox_sign/model/event_callback_request_event.py deleted file mode 100644 index 36fd019..0000000 --- a/dropbox_sign/model/event_callback_request_event.py +++ /dev/null @@ -1,362 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.event_callback_request_event_metadata import EventCallbackRequestEventMetadata - - -def lazy_import(): - from dropbox_sign.model.event_callback_request_event_metadata import EventCallbackRequestEventMetadata - globals()['EventCallbackRequestEventMetadata'] = EventCallbackRequestEventMetadata - - -class EventCallbackRequestEvent(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('event_type',): { - 'ACCOUNT_CONFIRMED': "account_confirmed", - 'UNKNOWN_ERROR': "unknown_error", - 'FILE_ERROR': "file_error", - 'SIGN_URL_INVALID': "sign_url_invalid", - 'SIGNATURE_REQUEST_VIEWED': "signature_request_viewed", - 'SIGNATURE_REQUEST_SIGNED': "signature_request_signed", - 'SIGNATURE_REQUEST_SENT': "signature_request_sent", - 'SIGNATURE_REQUEST_ALL_SIGNED': "signature_request_all_signed", - 'SIGNATURE_REQUEST_EMAIL_BOUNCE': "signature_request_email_bounce", - 'SIGNATURE_REQUEST_REMIND': "signature_request_remind", - 'SIGNATURE_REQUEST_INCOMPLETE_QES': "signature_request_incomplete_qes", - 'SIGNATURE_REQUEST_DESTROYED': "signature_request_destroyed", - 'SIGNATURE_REQUEST_CANCELED': "signature_request_canceled", - 'SIGNATURE_REQUEST_DOWNLOADABLE': "signature_request_downloadable", - 'SIGNATURE_REQUEST_DECLINED': "signature_request_declined", - 'SIGNATURE_REQUEST_REASSIGNED': "signature_request_reassigned", - 'SIGNATURE_REQUEST_INVALID': "signature_request_invalid", - 'SIGNATURE_REQUEST_PREPARED': "signature_request_prepared", - 'SIGNATURE_REQUEST_EXPIRED': "signature_request_expired", - 'TEMPLATE_CREATED': "template_created", - 'TEMPLATE_ERROR': "template_error", - 'CALLBACK_TEST': "callback_test", - 'SIGNATURE_REQUEST_SIGNER_REMOVED': "signature_request_signer_removed", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'event_time': (str,), # noqa: E501 - 'event_type': (str,), # noqa: E501 - 'event_hash': (str,), # noqa: E501 - 'event_metadata': (EventCallbackRequestEventMetadata,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EventCallbackRequestEvent: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EventCallbackRequestEvent], - _check_type=True, - ) - - attribute_map = { - 'event_time': 'event_time', # noqa: E501 - 'event_type': 'event_type', # noqa: E501 - 'event_hash': 'event_hash', # noqa: E501 - 'event_metadata': 'event_metadata', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def event_time(self) -> str: - return self.get("event_time") - - @event_time.setter - def event_time(self, value: str): - setattr(self, "event_time", value) - - @property - def event_type(self) -> str: - return self.get("event_type") - - @event_type.setter - def event_type(self, value: str): - setattr(self, "event_type", value) - - @property - def event_hash(self) -> str: - return self.get("event_hash") - - @event_hash.setter - def event_hash(self, value: str): - setattr(self, "event_hash", value) - - @property - def event_metadata(self) -> EventCallbackRequestEventMetadata: - return self.get("event_metadata") - - @event_metadata.setter - def event_metadata(self, value: EventCallbackRequestEventMetadata): - setattr(self, "event_metadata", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, event_time, event_type, event_hash, *args, **kwargs): # noqa: E501 - """EventCallbackRequestEvent - a model defined in OpenAPI - - Args: - event_time (str): Time the event was created (using Unix time). - event_type (str): Type of callback event that was triggered. - event_hash (str): Generated hash used to verify source of event data. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_metadata (EventCallbackRequestEventMetadata): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.event_time = event_time - self.event_type = event_type - self.event_hash = event_hash - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, event_time, event_type, event_hash, *args, **kwargs): # noqa: E501 - """EventCallbackRequestEvent - a model defined in OpenAPI - - Args: - event_time (str): Time the event was created (using Unix time). - event_type (str): Type of callback event that was triggered. - event_hash (str): Generated hash used to verify source of event data. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - event_metadata (EventCallbackRequestEventMetadata): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.event_time = event_time - self.event_type = event_type - self.event_hash = event_hash - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/event_callback_request_event_metadata.py b/dropbox_sign/model/event_callback_request_event_metadata.py deleted file mode 100644 index a0975c0..0000000 --- a/dropbox_sign/model/event_callback_request_event_metadata.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class EventCallbackRequestEventMetadata(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'related_signature_id': (str, none_type,), # noqa: E501 - 'reported_for_account_id': (str, none_type,), # noqa: E501 - 'reported_for_app_id': (str, none_type,), # noqa: E501 - 'event_message': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> EventCallbackRequestEventMetadata: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[EventCallbackRequestEventMetadata], - _check_type=True, - ) - - attribute_map = { - 'related_signature_id': 'related_signature_id', # noqa: E501 - 'reported_for_account_id': 'reported_for_account_id', # noqa: E501 - 'reported_for_app_id': 'reported_for_app_id', # noqa: E501 - 'event_message': 'event_message', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def related_signature_id(self) -> Optional[str]: - return self.get("related_signature_id") - - @related_signature_id.setter - def related_signature_id(self, value: Optional[str]): - setattr(self, "related_signature_id", value) - - @property - def reported_for_account_id(self) -> Optional[str]: - return self.get("reported_for_account_id") - - @reported_for_account_id.setter - def reported_for_account_id(self, value: Optional[str]): - setattr(self, "reported_for_account_id", value) - - @property - def reported_for_app_id(self) -> Optional[str]: - return self.get("reported_for_app_id") - - @reported_for_app_id.setter - def reported_for_app_id(self, value: Optional[str]): - setattr(self, "reported_for_app_id", value) - - @property - def event_message(self) -> Optional[str]: - return self.get("event_message") - - @event_message.setter - def event_message(self, value: Optional[str]): - setattr(self, "event_message", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """EventCallbackRequestEventMetadata - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - related_signature_id (str, none_type): Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events.. [optional] # noqa: E501 - reported_for_account_id (str, none_type): Account ID the event was reported for.. [optional] # noqa: E501 - reported_for_app_id (str, none_type): App ID the event was reported for.. [optional] # noqa: E501 - event_message (str, none_type): Message about a declined or failed (due to error) signature flow.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """EventCallbackRequestEventMetadata - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - related_signature_id (str, none_type): Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events.. [optional] # noqa: E501 - reported_for_account_id (str, none_type): Account ID the event was reported for.. [optional] # noqa: E501 - reported_for_app_id (str, none_type): App ID the event was reported for.. [optional] # noqa: E501 - event_message (str, none_type): Message about a declined or failed (due to error) signature flow.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/file_response.py b/dropbox_sign/model/file_response.py deleted file mode 100644 index 1eae681..0000000 --- a/dropbox_sign/model/file_response.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class FileResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'file_url': (str,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> FileResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[FileResponse], - _check_type=True, - ) - - attribute_map = { - 'file_url': 'file_url', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def file_url(self) -> str: - return self.get("file_url") - - @file_url.setter - def file_url(self, value: str): - setattr(self, "file_url", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FileResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file_url (str): URL to the file.. [optional] # noqa: E501 - expires_at (int): When the link expires.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FileResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - file_url (str): URL to the file.. [optional] # noqa: E501 - expires_at (int): When the link expires.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/file_response_data_uri.py b/dropbox_sign/model/file_response_data_uri.py deleted file mode 100644 index f103c7f..0000000 --- a/dropbox_sign/model/file_response_data_uri.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class FileResponseDataUri(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'data_uri': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> FileResponseDataUri: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[FileResponseDataUri], - _check_type=True, - ) - - attribute_map = { - 'data_uri': 'data_uri', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def data_uri(self) -> str: - return self.get("data_uri") - - @data_uri.setter - def data_uri(self, value: str): - setattr(self, "data_uri", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """FileResponseDataUri - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - data_uri (str): File as base64 encoded string.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """FileResponseDataUri - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - data_uri (str): File as base64 encoded string.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/list_info_response.py b/dropbox_sign/model/list_info_response.py deleted file mode 100644 index b50762f..0000000 --- a/dropbox_sign/model/list_info_response.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ListInfoResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'num_pages': (int,), # noqa: E501 - 'num_results': (int, none_type,), # noqa: E501 - 'page': (int,), # noqa: E501 - 'page_size': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ListInfoResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ListInfoResponse], - _check_type=True, - ) - - attribute_map = { - 'num_pages': 'num_pages', # noqa: E501 - 'num_results': 'num_results', # noqa: E501 - 'page': 'page', # noqa: E501 - 'page_size': 'page_size', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def num_pages(self) -> int: - return self.get("num_pages") - - @num_pages.setter - def num_pages(self, value: int): - setattr(self, "num_pages", value) - - @property - def num_results(self) -> Optional[int]: - return self.get("num_results") - - @num_results.setter - def num_results(self, value: Optional[int]): - setattr(self, "num_results", value) - - @property - def page(self) -> int: - return self.get("page") - - @page.setter - def page(self, value: int): - setattr(self, "page", value) - - @property - def page_size(self) -> int: - return self.get("page_size") - - @page_size.setter - def page_size(self, value: int): - setattr(self, "page_size", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ListInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - num_pages (int): Total number of pages available.. [optional] # noqa: E501 - num_results (int, none_type): Total number of objects available.. [optional] # noqa: E501 - page (int): Number of the page being returned.. [optional] # noqa: E501 - page_size (int): Objects returned per page.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ListInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - num_pages (int): Total number of pages available.. [optional] # noqa: E501 - num_results (int, none_type): Total number of objects available.. [optional] # noqa: E501 - page (int): Number of the page being returned.. [optional] # noqa: E501 - page_size (int): Objects returned per page.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/o_auth_token_generate_request.py b/dropbox_sign/model/o_auth_token_generate_request.py deleted file mode 100644 index 40269de..0000000 --- a/dropbox_sign/model/o_auth_token_generate_request.py +++ /dev/null @@ -1,347 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class OAuthTokenGenerateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'client_id': (str,), # noqa: E501 - 'client_secret': (str,), # noqa: E501 - 'code': (str,), # noqa: E501 - 'grant_type': (str,), # noqa: E501 - 'state': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> OAuthTokenGenerateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[OAuthTokenGenerateRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'client_secret': 'client_secret', # noqa: E501 - 'code': 'code', # noqa: E501 - 'grant_type': 'grant_type', # noqa: E501 - 'state': 'state', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def client_secret(self) -> str: - return self.get("client_secret") - - @client_secret.setter - def client_secret(self, value: str): - setattr(self, "client_secret", value) - - @property - def code(self) -> str: - return self.get("code") - - @code.setter - def code(self, value: str): - setattr(self, "code", value) - - @property - def grant_type(self) -> str: - return self.get("grant_type") - - @grant_type.setter - def grant_type(self, value: str): - setattr(self, "grant_type", value) - - @property - def state(self) -> str: - return self.get("state") - - @state.setter - def state(self, value: str): - setattr(self, "state", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, client_secret, code, state, *args, **kwargs): # noqa: E501 - """OAuthTokenGenerateRequest - a model defined in OpenAPI - - Args: - client_id (str): The client id of the app requesting authorization. - client_secret (str): The secret token of your app. - code (str): The code passed to your callback when the user granted access. - state (str): Same as the state you specified earlier. - - Keyword Args: - grant_type (str): When generating a new token use `authorization_code`.. defaults to "authorization_code" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - grant_type = kwargs.get('grant_type', "authorization_code") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.client_secret = client_secret - self.code = code - self.grant_type = grant_type - self.state = state - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, client_secret, code, state, *args, **kwargs): # noqa: E501 - """OAuthTokenGenerateRequest - a model defined in OpenAPI - - Args: - client_id (str): The client id of the app requesting authorization. - client_secret (str): The secret token of your app. - code (str): The code passed to your callback when the user granted access. - state (str): Same as the state you specified earlier. - - Keyword Args: - grant_type (str): When generating a new token use `authorization_code`.. defaults to "authorization_code" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - grant_type = kwargs.get('grant_type', "authorization_code") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.client_secret = client_secret - self.code = code - self.grant_type = grant_type - self.state = state - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/o_auth_token_refresh_request.py b/dropbox_sign/model/o_auth_token_refresh_request.py deleted file mode 100644 index 6165d39..0000000 --- a/dropbox_sign/model/o_auth_token_refresh_request.py +++ /dev/null @@ -1,305 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class OAuthTokenRefreshRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'grant_type': (str,), # noqa: E501 - 'refresh_token': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> OAuthTokenRefreshRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[OAuthTokenRefreshRequest], - _check_type=True, - ) - - attribute_map = { - 'grant_type': 'grant_type', # noqa: E501 - 'refresh_token': 'refresh_token', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def grant_type(self) -> str: - return self.get("grant_type") - - @grant_type.setter - def grant_type(self, value: str): - setattr(self, "grant_type", value) - - @property - def refresh_token(self) -> str: - return self.get("refresh_token") - - @refresh_token.setter - def refresh_token(self, value: str): - setattr(self, "refresh_token", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, refresh_token, *args, **kwargs): # noqa: E501 - """OAuthTokenRefreshRequest - a model defined in OpenAPI - - Args: - refresh_token (str): The token provided when you got the expired access token. - - Keyword Args: - grant_type (str): When refreshing an existing token use `refresh_token`.. defaults to "refresh_token" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - grant_type = kwargs.get('grant_type', "refresh_token") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.grant_type = grant_type - self.refresh_token = refresh_token - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, refresh_token, *args, **kwargs): # noqa: E501 - """OAuthTokenRefreshRequest - a model defined in OpenAPI - - Args: - refresh_token (str): The token provided when you got the expired access token. - - Keyword Args: - grant_type (str): When refreshing an existing token use `refresh_token`.. defaults to "refresh_token" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - grant_type = kwargs.get('grant_type', "refresh_token") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.grant_type = grant_type - self.refresh_token = refresh_token - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/o_auth_token_response.py b/dropbox_sign/model/o_auth_token_response.py deleted file mode 100644 index 56faff8..0000000 --- a/dropbox_sign/model/o_auth_token_response.py +++ /dev/null @@ -1,331 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class OAuthTokenResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'access_token': (str,), # noqa: E501 - 'token_type': (str,), # noqa: E501 - 'refresh_token': (str,), # noqa: E501 - 'expires_in': (int,), # noqa: E501 - 'state': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> OAuthTokenResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[OAuthTokenResponse], - _check_type=True, - ) - - attribute_map = { - 'access_token': 'access_token', # noqa: E501 - 'token_type': 'token_type', # noqa: E501 - 'refresh_token': 'refresh_token', # noqa: E501 - 'expires_in': 'expires_in', # noqa: E501 - 'state': 'state', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def access_token(self) -> str: - return self.get("access_token") - - @access_token.setter - def access_token(self, value: str): - setattr(self, "access_token", value) - - @property - def token_type(self) -> str: - return self.get("token_type") - - @token_type.setter - def token_type(self, value: str): - setattr(self, "token_type", value) - - @property - def refresh_token(self) -> str: - return self.get("refresh_token") - - @refresh_token.setter - def refresh_token(self, value: str): - setattr(self, "refresh_token", value) - - @property - def expires_in(self) -> int: - return self.get("expires_in") - - @expires_in.setter - def expires_in(self, value: int): - setattr(self, "expires_in", value) - - @property - def state(self) -> Optional[str]: - return self.get("state") - - @state.setter - def state(self, value: Optional[str]): - setattr(self, "state", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """OAuthTokenResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - access_token (str): [optional] # noqa: E501 - token_type (str): [optional] # noqa: E501 - refresh_token (str): [optional] # noqa: E501 - expires_in (int): Number of seconds until the `access_token` expires. Uses epoch time.. [optional] # noqa: E501 - state (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """OAuthTokenResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - access_token (str): [optional] # noqa: E501 - token_type (str): [optional] # noqa: E501 - refresh_token (str): [optional] # noqa: E501 - expires_in (int): Number of seconds until the `access_token` expires. Uses epoch time.. [optional] # noqa: E501 - state (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/report_create_request.py b/dropbox_sign/model/report_create_request.py deleted file mode 100644 index 7a749fa..0000000 --- a/dropbox_sign/model/report_create_request.py +++ /dev/null @@ -1,325 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ReportCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('report_type',): { - 'USER_ACTIVITY': "user_activity", - 'DOCUMENT_STATUS': "document_status", - }, - } - - validations = { - ('report_type',): { - 'max_items': 2, - 'min_items': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'end_date': (str,), # noqa: E501 - 'report_type': ([str],), # noqa: E501 - 'start_date': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ReportCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ReportCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'end_date': 'end_date', # noqa: E501 - 'report_type': 'report_type', # noqa: E501 - 'start_date': 'start_date', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def end_date(self) -> str: - return self.get("end_date") - - @end_date.setter - def end_date(self, value: str): - setattr(self, "end_date", value) - - @property - def report_type(self) -> List[str]: - return self.get("report_type") - - @report_type.setter - def report_type(self, value: List[str]): - setattr(self, "report_type", value) - - @property - def start_date(self) -> str: - return self.get("start_date") - - @start_date.setter - def start_date(self, value: str): - setattr(self, "start_date", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, end_date, report_type, start_date, *args, **kwargs): # noqa: E501 - """ReportCreateRequest - a model defined in OpenAPI - - Args: - end_date (str): The (inclusive) end date for the report data in `MM/DD/YYYY` format. - report_type ([str]): The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). - start_date (str): The (inclusive) start date for the report data in `MM/DD/YYYY` format. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.end_date = end_date - self.report_type = report_type - self.start_date = start_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, end_date, report_type, start_date, *args, **kwargs): # noqa: E501 - """ReportCreateRequest - a model defined in OpenAPI - - Args: - end_date (str): The (inclusive) end date for the report data in `MM/DD/YYYY` format. - report_type ([str]): The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status). - start_date (str): The (inclusive) start date for the report data in `MM/DD/YYYY` format. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.end_date = end_date - self.report_type = report_type - self.start_date = start_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/report_create_response.py b/dropbox_sign/model/report_create_response.py deleted file mode 100644 index 6c6c14c..0000000 --- a/dropbox_sign/model/report_create_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.report_response import ReportResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.report_response import ReportResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ReportResponse'] = ReportResponse - globals()['WarningResponse'] = WarningResponse - - -class ReportCreateResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'report': (ReportResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ReportCreateResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ReportCreateResponse], - _check_type=True, - ) - - attribute_map = { - 'report': 'report', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def report(self) -> ReportResponse: - return self.get("report") - - @report.setter - def report(self, value: ReportResponse): - setattr(self, "report", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ReportCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - report (ReportResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ReportCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - report (ReportResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/report_response.py b/dropbox_sign/model/report_response.py deleted file mode 100644 index 2ac5c4d..0000000 --- a/dropbox_sign/model/report_response.py +++ /dev/null @@ -1,323 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class ReportResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('report_type',): { - 'USER_ACTIVITY': "user_activity", - 'DOCUMENT_STATUS': "document_status", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'success': (str,), # noqa: E501 - 'start_date': (str,), # noqa: E501 - 'end_date': (str,), # noqa: E501 - 'report_type': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> ReportResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[ReportResponse], - _check_type=True, - ) - - attribute_map = { - 'success': 'success', # noqa: E501 - 'start_date': 'start_date', # noqa: E501 - 'end_date': 'end_date', # noqa: E501 - 'report_type': 'report_type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def success(self) -> str: - return self.get("success") - - @success.setter - def success(self, value: str): - setattr(self, "success", value) - - @property - def start_date(self) -> str: - return self.get("start_date") - - @start_date.setter - def start_date(self, value: str): - setattr(self, "start_date", value) - - @property - def end_date(self) -> str: - return self.get("end_date") - - @end_date.setter - def end_date(self, value: str): - setattr(self, "end_date", value) - - @property - def report_type(self) -> List[str]: - return self.get("report_type") - - @report_type.setter - def report_type(self, value: List[str]): - setattr(self, "report_type", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ReportResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - success (str): A message indicating the requested operation's success. [optional] # noqa: E501 - start_date (str): The (inclusive) start date for the report data in MM/DD/YYYY format.. [optional] # noqa: E501 - end_date (str): The (inclusive) end date for the report data in MM/DD/YYYY format.. [optional] # noqa: E501 - report_type ([str]): The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ReportResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - success (str): A message indicating the requested operation's success. [optional] # noqa: E501 - start_date (str): The (inclusive) start date for the report data in MM/DD/YYYY format.. [optional] # noqa: E501 - end_date (str): The (inclusive) end date for the report data in MM/DD/YYYY format.. [optional] # noqa: E501 - report_type ([str]): The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_bulk_create_embedded_with_template_request.py b/dropbox_sign/model/signature_request_bulk_create_embedded_with_template_request.py deleted file mode 100644 index 5ec5518..0000000 --- a/dropbox_sign/model/signature_request_bulk_create_embedded_with_template_request.py +++ /dev/null @@ -1,460 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_bulk_signer_list import SubBulkSignerList - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - - -def lazy_import(): - from dropbox_sign.model.sub_bulk_signer_list import SubBulkSignerList - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - globals()['SubBulkSignerList'] = SubBulkSignerList - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - - -class SignatureRequestBulkCreateEmbeddedWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'signer_file': (file_type,), # noqa: E501 - 'signer_list': ([SubBulkSignerList],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestBulkCreateEmbeddedWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestBulkCreateEmbeddedWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'signer_file': 'signer_file', # noqa: E501 - 'signer_list': 'signer_list', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def signer_file(self) -> file_type: - return self.get("signer_file") - - @signer_file.setter - def signer_file(self, value: file_type): - setattr(self, "signer_file", value) - - @property - def signer_list(self) -> List[SubBulkSignerList]: - return self.get("signer_list") - - @signer_list.setter - def signer_list(self, value: List[SubBulkSignerList]): - setattr(self, "signer_list", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestBulkCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signer_file (file_type): `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```. [optional] # noqa: E501 - signer_list ([SubBulkSignerList]): `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestBulkCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signer_file (file_type): `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```. [optional] # noqa: E501 - signer_list ([SubBulkSignerList]): `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_bulk_send_with_template_request.py b/dropbox_sign/model/signature_request_bulk_send_with_template_request.py deleted file mode 100644 index ff6b3f3..0000000 --- a/dropbox_sign/model/signature_request_bulk_send_with_template_request.py +++ /dev/null @@ -1,458 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_bulk_signer_list import SubBulkSignerList - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - - -def lazy_import(): - from dropbox_sign.model.sub_bulk_signer_list import SubBulkSignerList - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - globals()['SubBulkSignerList'] = SubBulkSignerList - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - - -class SignatureRequestBulkSendWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'signer_file': (file_type,), # noqa: E501 - 'signer_list': ([SubBulkSignerList],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestBulkSendWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestBulkSendWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'signer_file': 'signer_file', # noqa: E501 - 'signer_list': 'signer_list', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def signer_file(self) -> file_type: - return self.get("signer_file") - - @signer_file.setter - def signer_file(self, value: file_type): - setattr(self, "signer_file", value) - - @property - def signer_list(self) -> List[SubBulkSignerList]: - return self.get("signer_list") - - @signer_list.setter - def signer_list(self, value: List[SubBulkSignerList]): - setattr(self, "signer_list", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, *args, **kwargs): # noqa: E501 - """SignatureRequestBulkSendWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signer_file (file_type): `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```. [optional] # noqa: E501 - signer_list ([SubBulkSignerList]): `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, *args, **kwargs): # noqa: E501 - """SignatureRequestBulkSendWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signer_file (file_type): `signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```. [optional] # noqa: E501 - signer_list ([SubBulkSignerList]): `signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_create_embedded_request.py b/dropbox_sign/model/signature_request_create_embedded_request.py deleted file mode 100644 index 962e24c..0000000 --- a/dropbox_sign/model/signature_request_create_embedded_request.py +++ /dev/null @@ -1,608 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSignatureRequestGroupedSigners'] = SubSignatureRequestGroupedSigners - globals()['SubSignatureRequestSigner'] = SubSignatureRequestSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestCreateEmbeddedRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestSigner],), # noqa: E501 - 'grouped_signers': ([SubSignatureRequestGroupedSigners],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestCreateEmbeddedRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestCreateEmbeddedRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'grouped_signers': 'grouped_signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def signers(self) -> List[SubSignatureRequestSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestSigner]): - setattr(self, "signers", value) - - @property - def grouped_signers(self) -> List[SubSignatureRequestGroupedSigners]: - return self.get("grouped_signers") - - @grouped_signers.setter - def grouped_signers(self, value: List[SubSignatureRequestGroupedSigners]): - setattr(self, "grouped_signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestCreateEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestCreateEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_create_embedded_with_template_request.py b/dropbox_sign/model/signature_request_create_embedded_with_template_request.py deleted file mode 100644 index 437351b..0000000 --- a/dropbox_sign/model/signature_request_create_embedded_with_template_request.py +++ /dev/null @@ -1,489 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - globals()['SubSignatureRequestTemplateSigner'] = SubSignatureRequestTemplateSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestCreateEmbeddedWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'signers': ([SubSignatureRequestTemplateSigner],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestCreateEmbeddedWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestCreateEmbeddedWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def signers(self) -> List[SubSignatureRequestTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestTemplateSigner]): - setattr(self, "signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, client_id, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, client_id, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_edit_embedded_request.py b/dropbox_sign/model/signature_request_edit_embedded_request.py deleted file mode 100644 index 831290e..0000000 --- a/dropbox_sign/model/signature_request_edit_embedded_request.py +++ /dev/null @@ -1,608 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSignatureRequestGroupedSigners'] = SubSignatureRequestGroupedSigners - globals()['SubSignatureRequestSigner'] = SubSignatureRequestSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestEditEmbeddedRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestSigner],), # noqa: E501 - 'grouped_signers': ([SubSignatureRequestGroupedSigners],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestEditEmbeddedRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestEditEmbeddedRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'grouped_signers': 'grouped_signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def signers(self) -> List[SubSignatureRequestSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestSigner]): - setattr(self, "signers", value) - - @property - def grouped_signers(self) -> List[SubSignatureRequestGroupedSigners]: - return self.get("grouped_signers") - - @grouped_signers.setter - def grouped_signers(self, value: List[SubSignatureRequestGroupedSigners]): - setattr(self, "grouped_signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestEditEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, *args, **kwargs): # noqa: E501 - """SignatureRequestEditEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_edit_embedded_with_template_request.py b/dropbox_sign/model/signature_request_edit_embedded_with_template_request.py deleted file mode 100644 index 8e3e2cb..0000000 --- a/dropbox_sign/model/signature_request_edit_embedded_with_template_request.py +++ /dev/null @@ -1,489 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - globals()['SubSignatureRequestTemplateSigner'] = SubSignatureRequestTemplateSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestEditEmbeddedWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'signers': ([SubSignatureRequestTemplateSigner],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestEditEmbeddedWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestEditEmbeddedWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def signers(self) -> List[SubSignatureRequestTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestTemplateSigner]): - setattr(self, "signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, client_id, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestEditEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, client_id, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestEditEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - client_id (str): Client id of the app you're using to create this embedded signature request. Used for security purposes. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.client_id = client_id - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_edit_request.py b/dropbox_sign/model/signature_request_edit_request.py deleted file mode 100644 index 42d01ad..0000000 --- a/dropbox_sign/model/signature_request_edit_request.py +++ /dev/null @@ -1,626 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSignatureRequestGroupedSigners'] = SubSignatureRequestGroupedSigners - globals()['SubSignatureRequestSigner'] = SubSignatureRequestSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestEditRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestSigner],), # noqa: E501 - 'grouped_signers': ([SubSignatureRequestGroupedSigners],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'is_qualified_signature': (bool,), # noqa: E501 - 'is_eid': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestEditRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestEditRequest], - _check_type=True, - ) - - attribute_map = { - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'grouped_signers': 'grouped_signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'is_qualified_signature': 'is_qualified_signature', # noqa: E501 - 'is_eid': 'is_eid', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def signers(self) -> List[SubSignatureRequestSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestSigner]): - setattr(self, "signers", value) - - @property - def grouped_signers(self) -> List[SubSignatureRequestGroupedSigners]: - return self.get("grouped_signers") - - @grouped_signers.setter - def grouped_signers(self, value: List[SubSignatureRequestGroupedSigners]): - setattr(self, "grouped_signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def is_qualified_signature(self) -> bool: - return self.get("is_qualified_signature") - - @is_qualified_signature.setter - def is_qualified_signature(self, value: bool): - setattr(self, "is_qualified_signature", value) - - @property - def is_eid(self) -> bool: - return self.get("is_eid") - - @is_eid.setter - def is_eid(self, value: bool): - setattr(self, "is_eid", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestEditRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestEditRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_edit_with_template_request.py b/dropbox_sign/model/signature_request_edit_with_template_request.py deleted file mode 100644 index 380a06b..0000000 --- a/dropbox_sign/model/signature_request_edit_with_template_request.py +++ /dev/null @@ -1,511 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - globals()['SubSignatureRequestTemplateSigner'] = SubSignatureRequestTemplateSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestEditWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestTemplateSigner],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'is_qualified_signature': (bool,), # noqa: E501 - 'is_eid': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestEditWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestEditWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'is_qualified_signature': 'is_qualified_signature', # noqa: E501 - 'is_eid': 'is_eid', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def signers(self) -> List[SubSignatureRequestTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestTemplateSigner]): - setattr(self, "signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def is_qualified_signature(self) -> bool: - return self.get("is_qualified_signature") - - @is_qualified_signature.setter - def is_qualified_signature(self, value: bool): - setattr(self, "is_qualified_signature", value) - - @property - def is_eid(self) -> bool: - return self.get("is_eid") - - @is_eid.setter - def is_eid(self, value: bool): - setattr(self, "is_eid", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestEditWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestEditWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_get_response.py b/dropbox_sign/model/signature_request_get_response.py deleted file mode 100644 index c07ff1d..0000000 --- a/dropbox_sign/model/signature_request_get_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['SignatureRequestResponse'] = SignatureRequestResponse - globals()['WarningResponse'] = WarningResponse - - -class SignatureRequestGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'signature_request': (SignatureRequestResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestGetResponse], - _check_type=True, - ) - - attribute_map = { - 'signature_request': 'signature_request', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def signature_request(self) -> SignatureRequestResponse: - return self.get("signature_request") - - @signature_request.setter - def signature_request(self, value: SignatureRequestResponse): - setattr(self, "signature_request", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_request (SignatureRequestResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_request (SignatureRequestResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_list_response.py b/dropbox_sign/model/signature_request_list_response.py deleted file mode 100644 index a6f5fbe..0000000 --- a/dropbox_sign/model/signature_request_list_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.signature_request_response import SignatureRequestResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['SignatureRequestResponse'] = SignatureRequestResponse - globals()['WarningResponse'] = WarningResponse - - -class SignatureRequestListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'signature_requests': ([SignatureRequestResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestListResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestListResponse], - _check_type=True, - ) - - attribute_map = { - 'signature_requests': 'signature_requests', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def signature_requests(self) -> List[SignatureRequestResponse]: - return self.get("signature_requests") - - @signature_requests.setter - def signature_requests(self, value: List[SignatureRequestResponse]): - setattr(self, "signature_requests", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_requests ([SignatureRequestResponse]): Contains information about signature requests.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_requests ([SignatureRequestResponse]): Contains information about signature requests.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_remind_request.py b/dropbox_sign/model/signature_request_remind_request.py deleted file mode 100644 index ba4dc84..0000000 --- a/dropbox_sign/model/signature_request_remind_request.py +++ /dev/null @@ -1,301 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestRemindRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestRemindRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestRemindRequest], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email_address, *args, **kwargs): # noqa: E501 - """SignatureRequestRemindRequest - a model defined in OpenAPI - - Args: - email_address (str): The email address of the signer to send a reminder to. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the signer to send a reminder to. Include if two or more signers share an email address.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, email_address, *args, **kwargs): # noqa: E501 - """SignatureRequestRemindRequest - a model defined in OpenAPI - - Args: - email_address (str): The email address of the signer to send a reminder to. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the signer to send a reminder to. Include if two or more signers share an email address.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_response.py b/dropbox_sign/model/signature_request_response.py deleted file mode 100644 index 79929fb..0000000 --- a/dropbox_sign/model/signature_request_response.py +++ /dev/null @@ -1,588 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_attachment import SignatureRequestResponseAttachment - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - from dropbox_sign.model.signature_request_response_signatures import SignatureRequestResponseSignatures - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_attachment import SignatureRequestResponseAttachment - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - from dropbox_sign.model.signature_request_response_signatures import SignatureRequestResponseSignatures - globals()['SignatureRequestResponseAttachment'] = SignatureRequestResponseAttachment - globals()['SignatureRequestResponseCustomFieldBase'] = SignatureRequestResponseCustomFieldBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - globals()['SignatureRequestResponseSignatures'] = SignatureRequestResponseSignatures - - -class SignatureRequestResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'test_mode': (bool, none_type,), # noqa: E501 - 'signature_request_id': (str,), # noqa: E501 - 'requester_email_address': (str,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'original_title': (str,), # noqa: E501 - 'subject': (str, none_type,), # noqa: E501 - 'message': (str, none_type,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'created_at': (int,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - 'is_complete': (bool,), # noqa: E501 - 'is_declined': (bool,), # noqa: E501 - 'has_error': (bool,), # noqa: E501 - 'files_url': (str,), # noqa: E501 - 'signing_url': (str, none_type,), # noqa: E501 - 'details_url': (str,), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'signing_redirect_url': (str, none_type,), # noqa: E501 - 'final_copy_uri': (str, none_type,), # noqa: E501 - 'template_ids': ([str], none_type,), # noqa: E501 - 'custom_fields': ([SignatureRequestResponseCustomFieldBase], none_type,), # noqa: E501 - 'attachments': ([SignatureRequestResponseAttachment], none_type,), # noqa: E501 - 'response_data': ([SignatureRequestResponseDataBase], none_type,), # noqa: E501 - 'signatures': ([SignatureRequestResponseSignatures],), # noqa: E501 - 'bulk_send_job_id': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponse], - _check_type=True, - ) - - attribute_map = { - 'test_mode': 'test_mode', # noqa: E501 - 'signature_request_id': 'signature_request_id', # noqa: E501 - 'requester_email_address': 'requester_email_address', # noqa: E501 - 'title': 'title', # noqa: E501 - 'original_title': 'original_title', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'created_at': 'created_at', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - 'is_complete': 'is_complete', # noqa: E501 - 'is_declined': 'is_declined', # noqa: E501 - 'has_error': 'has_error', # noqa: E501 - 'files_url': 'files_url', # noqa: E501 - 'signing_url': 'signing_url', # noqa: E501 - 'details_url': 'details_url', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'final_copy_uri': 'final_copy_uri', # noqa: E501 - 'template_ids': 'template_ids', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'response_data': 'response_data', # noqa: E501 - 'signatures': 'signatures', # noqa: E501 - 'bulk_send_job_id': 'bulk_send_job_id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def test_mode(self) -> Optional[bool]: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: Optional[bool]): - setattr(self, "test_mode", value) - - @property - def signature_request_id(self) -> str: - return self.get("signature_request_id") - - @signature_request_id.setter - def signature_request_id(self, value: str): - setattr(self, "signature_request_id", value) - - @property - def requester_email_address(self) -> str: - return self.get("requester_email_address") - - @requester_email_address.setter - def requester_email_address(self, value: str): - setattr(self, "requester_email_address", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def original_title(self) -> str: - return self.get("original_title") - - @original_title.setter - def original_title(self, value: str): - setattr(self, "original_title", value) - - @property - def subject(self) -> Optional[str]: - return self.get("subject") - - @subject.setter - def subject(self, value: Optional[str]): - setattr(self, "subject", value) - - @property - def message(self) -> Optional[str]: - return self.get("message") - - @message.setter - def message(self, value: Optional[str]): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def created_at(self) -> int: - return self.get("created_at") - - @created_at.setter - def created_at(self, value: int): - setattr(self, "created_at", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @property - def is_complete(self) -> bool: - return self.get("is_complete") - - @is_complete.setter - def is_complete(self, value: bool): - setattr(self, "is_complete", value) - - @property - def is_declined(self) -> bool: - return self.get("is_declined") - - @is_declined.setter - def is_declined(self, value: bool): - setattr(self, "is_declined", value) - - @property - def has_error(self) -> bool: - return self.get("has_error") - - @has_error.setter - def has_error(self, value: bool): - setattr(self, "has_error", value) - - @property - def files_url(self) -> str: - return self.get("files_url") - - @files_url.setter - def files_url(self, value: str): - setattr(self, "files_url", value) - - @property - def signing_url(self) -> Optional[str]: - return self.get("signing_url") - - @signing_url.setter - def signing_url(self, value: Optional[str]): - setattr(self, "signing_url", value) - - @property - def details_url(self) -> str: - return self.get("details_url") - - @details_url.setter - def details_url(self, value: str): - setattr(self, "details_url", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def signing_redirect_url(self) -> Optional[str]: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: Optional[str]): - setattr(self, "signing_redirect_url", value) - - @property - def final_copy_uri(self) -> Optional[str]: - return self.get("final_copy_uri") - - @final_copy_uri.setter - def final_copy_uri(self, value: Optional[str]): - setattr(self, "final_copy_uri", value) - - @property - def template_ids(self) -> Optional[List[str]]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: Optional[List[str]]): - setattr(self, "template_ids", value) - - @property - def custom_fields(self) -> Optional[List[SignatureRequestResponseCustomFieldBase]]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: Optional[List[SignatureRequestResponseCustomFieldBase]]): - setattr(self, "custom_fields", value) - - @property - def attachments(self) -> Optional[List[SignatureRequestResponseAttachment]]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: Optional[List[SignatureRequestResponseAttachment]]): - setattr(self, "attachments", value) - - @property - def response_data(self) -> Optional[List[SignatureRequestResponseDataBase]]: - return self.get("response_data") - - @response_data.setter - def response_data(self, value: Optional[List[SignatureRequestResponseDataBase]]): - setattr(self, "response_data", value) - - @property - def signatures(self) -> List[SignatureRequestResponseSignatures]: - return self.get("signatures") - - @signatures.setter - def signatures(self, value: List[SignatureRequestResponseSignatures]): - setattr(self, "signatures", value) - - @property - def bulk_send_job_id(self) -> Optional[str]: - return self.get("bulk_send_job_id") - - @bulk_send_job_id.setter - def bulk_send_job_id(self, value: Optional[str]): - setattr(self, "bulk_send_job_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - test_mode (bool, none_type): Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - signature_request_id (str): The id of the SignatureRequest.. [optional] # noqa: E501 - requester_email_address (str): The email address of the initiator of the SignatureRequest.. [optional] # noqa: E501 - title (str): The title the specified Account uses for the SignatureRequest.. [optional] # noqa: E501 - original_title (str): Default Label for account.. [optional] # noqa: E501 - subject (str, none_type): The subject in the email that was initially sent to the signers.. [optional] # noqa: E501 - message (str, none_type): The custom message in the email that was initially sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the signature request.. [optional] # noqa: E501 - created_at (int): Time the signature request was created.. [optional] # noqa: E501 - expires_at (int): The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - is_complete (bool): Whether or not the SignatureRequest has been fully executed by all signers.. [optional] # noqa: E501 - is_declined (bool): Whether or not the SignatureRequest has been declined by a signer.. [optional] # noqa: E501 - has_error (bool): Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).. [optional] # noqa: E501 - files_url (str): The URL where a copy of the request's documents can be downloaded.. [optional] # noqa: E501 - signing_url (str, none_type): The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.. [optional] # noqa: E501 - details_url (str): The URL where the requester and the signers can view the current status of the SignatureRequest.. [optional] # noqa: E501 - cc_email_addresses ([str]): A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want the signer redirected to after they successfully sign.. [optional] # noqa: E501 - final_copy_uri (str, none_type): The path where the completed document can be downloaded. [optional] # noqa: E501 - template_ids ([str], none_type): Templates IDs used in this SignatureRequest (if any).. [optional] # noqa: E501 - custom_fields ([SignatureRequestResponseCustomFieldBase], none_type): An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`. [optional] # noqa: E501 - attachments ([SignatureRequestResponseAttachment], none_type): Signer attachments.. [optional] # noqa: E501 - response_data ([SignatureRequestResponseDataBase], none_type): An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.. [optional] # noqa: E501 - signatures ([SignatureRequestResponseSignatures]): An array of signature objects, 1 for each signer.. [optional] # noqa: E501 - bulk_send_job_id (str, none_type): The ID of the Bulk Send job which sent the signature request, if applicable.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - test_mode (bool, none_type): Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - signature_request_id (str): The id of the SignatureRequest.. [optional] # noqa: E501 - requester_email_address (str): The email address of the initiator of the SignatureRequest.. [optional] # noqa: E501 - title (str): The title the specified Account uses for the SignatureRequest.. [optional] # noqa: E501 - original_title (str): Default Label for account.. [optional] # noqa: E501 - subject (str, none_type): The subject in the email that was initially sent to the signers.. [optional] # noqa: E501 - message (str, none_type): The custom message in the email that was initially sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the signature request.. [optional] # noqa: E501 - created_at (int): Time the signature request was created.. [optional] # noqa: E501 - expires_at (int): The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - is_complete (bool): Whether or not the SignatureRequest has been fully executed by all signers.. [optional] # noqa: E501 - is_declined (bool): Whether or not the SignatureRequest has been declined by a signer.. [optional] # noqa: E501 - has_error (bool): Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).. [optional] # noqa: E501 - files_url (str): The URL where a copy of the request's documents can be downloaded.. [optional] # noqa: E501 - signing_url (str, none_type): The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.. [optional] # noqa: E501 - details_url (str): The URL where the requester and the signers can view the current status of the SignatureRequest.. [optional] # noqa: E501 - cc_email_addresses ([str]): A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want the signer redirected to after they successfully sign.. [optional] # noqa: E501 - final_copy_uri (str, none_type): The path where the completed document can be downloaded. [optional] # noqa: E501 - template_ids ([str], none_type): Templates IDs used in this SignatureRequest (if any).. [optional] # noqa: E501 - custom_fields ([SignatureRequestResponseCustomFieldBase], none_type): An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`. [optional] # noqa: E501 - attachments ([SignatureRequestResponseAttachment], none_type): Signer attachments.. [optional] # noqa: E501 - response_data ([SignatureRequestResponseDataBase], none_type): An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.. [optional] # noqa: E501 - signatures ([SignatureRequestResponseSignatures]): An array of signature objects, 1 for each signer.. [optional] # noqa: E501 - bulk_send_job_id (str, none_type): The ID of the Bulk Send job which sent the signature request, if applicable.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_response_attachment.py b/dropbox_sign/model/signature_request_response_attachment.py deleted file mode 100644 index 30c68fe..0000000 --- a/dropbox_sign/model/signature_request_response_attachment.py +++ /dev/null @@ -1,355 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestResponseAttachment(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'instructions': (str, none_type,), # noqa: E501 - 'uploaded_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseAttachment: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseAttachment], - _check_type=True, - ) - - attribute_map = { - 'id': 'id', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - 'instructions': 'instructions', # noqa: E501 - 'uploaded_at': 'uploaded_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def id(self) -> str: - return self.get("id") - - @id.setter - def id(self, value: str): - setattr(self, "id", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def instructions(self) -> Optional[str]: - return self.get("instructions") - - @instructions.setter - def instructions(self, value: Optional[str]): - setattr(self, "instructions", value) - - @property - def uploaded_at(self) -> Optional[int]: - return self.get("uploaded_at") - - @uploaded_at.setter - def uploaded_at(self, value: Optional[int]): - setattr(self, "uploaded_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, id, signer, name, required, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseAttachment - a model defined in OpenAPI - - Args: - id (str): The unique ID for this attachment. - signer (str): The Signer this attachment is assigned to. - name (str): The name of this attachment. - required (bool): A boolean value denoting if this attachment is required. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - instructions (str, none_type): Instructions for Signer.. [optional] # noqa: E501 - uploaded_at (int, none_type): Timestamp when attachment was uploaded by Signer.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.signer = signer - self.name = name - self.required = required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, id, signer, name, required, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseAttachment - a model defined in OpenAPI - - Args: - id (str): The unique ID for this attachment. - signer (str): The Signer this attachment is assigned to. - name (str): The name of this attachment. - required (bool): A boolean value denoting if this attachment is required. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - instructions (str, none_type): Instructions for Signer.. [optional] # noqa: E501 - uploaded_at (int, none_type): Timestamp when attachment was uploaded by Signer.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.signer = signer - self.name = name - self.required = required - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_response_custom_field_base.py b/dropbox_sign/model/signature_request_response_custom_field_base.py deleted file mode 100644 index 9ebfcc6..0000000 --- a/dropbox_sign/model/signature_request_response_custom_field_base.py +++ /dev/null @@ -1,342 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import SignatureRequestResponseCustomFieldCheckbox - from dropbox_sign.models import SignatureRequestResponseCustomFieldText - - -def lazy_import(): - from dropbox_sign.models import SignatureRequestResponseCustomFieldCheckbox - from dropbox_sign.models import SignatureRequestResponseCustomFieldText - globals()['SignatureRequestResponseCustomFieldCheckbox'] = SignatureRequestResponseCustomFieldCheckbox - globals()['SignatureRequestResponseCustomFieldText'] = SignatureRequestResponseCustomFieldText - - -class SignatureRequestResponseCustomFieldBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'editor': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': SignatureRequestResponseCustomFieldCheckbox, - 'text': SignatureRequestResponseCustomFieldText, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'type': 'type', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'editor': 'editor', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def editor(self) -> str: - return self.get("editor") - - @editor.setter - def editor(self, value: str): - setattr(self, "editor", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, name, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldBase - a model defined in OpenAPI - - Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. - name (str): The name of the Custom Field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, name, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldBase - a model defined in OpenAPI - - Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. - name (str): The name of the Custom Field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_response_custom_field_checkbox.py b/dropbox_sign/model/signature_request_response_custom_field_checkbox.py deleted file mode 100644 index 5975398..0000000 --- a/dropbox_sign/model/signature_request_response_custom_field_checkbox.py +++ /dev/null @@ -1,401 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - globals()['SignatureRequestResponseCustomFieldBase'] = SignatureRequestResponseCustomFieldBase - - -class SignatureRequestResponseCustomFieldCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'value': (bool,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'editor': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseCustomFieldCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseCustomFieldCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'name': 'name', # noqa: E501 - 'value': 'value', # noqa: E501 - 'required': 'required', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'editor': 'editor', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def value(self) -> bool: - return self.get("value") - - @value.setter - def value(self, value: bool): - setattr(self, "value", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def editor(self) -> str: - return self.get("editor") - - @editor.setter - def editor(self, value: str): - setattr(self, "editor", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.. defaults to "checkbox" # noqa: E501 - name (str): The name of the Custom Field. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (bool): A true/false for checkbox fields. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.. defaults to "checkbox" # noqa: E501 - name (str): The name of the Custom Field. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (bool): A true/false for checkbox fields. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/signature_request_response_custom_field_text.py b/dropbox_sign/model/signature_request_response_custom_field_text.py deleted file mode 100644 index bb4aeca..0000000 --- a/dropbox_sign/model/signature_request_response_custom_field_text.py +++ /dev/null @@ -1,401 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase - globals()['SignatureRequestResponseCustomFieldBase'] = SignatureRequestResponseCustomFieldBase - - -class SignatureRequestResponseCustomFieldText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'editor': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseCustomFieldText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseCustomFieldText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'name': 'name', # noqa: E501 - 'value': 'value', # noqa: E501 - 'required': 'required', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'editor': 'editor', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def editor(self) -> str: - return self.get("editor") - - @editor.setter - def editor(self, value: str): - setattr(self, "editor", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.. defaults to "text" # noqa: E501 - name (str): The name of the Custom Field. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (str): A text string for text fields. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseCustomFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.. defaults to "text" # noqa: E501 - name (str): The name of the Custom Field. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (str): A text string for text fields. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - editor (str): The name of the Role that is able to edit this field.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/signature_request_response_custom_field_type_enum.py b/dropbox_sign/model/signature_request_response_custom_field_type_enum.py deleted file mode 100644 index 5cd1755..0000000 --- a/dropbox_sign/model/signature_request_response_custom_field_type_enum.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestResponseCustomFieldTypeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'TEXT': "text", - 'CHECKBOX': "checkbox", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseCustomFieldTypeEnum: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseCustomFieldTypeEnum], - _check_type=True, - ) - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """SignatureRequestResponseCustomFieldTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["text", "checkbox", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["text", "checkbox", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """SignatureRequestResponseCustomFieldTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["text", "checkbox", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["text", "checkbox", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/dropbox_sign/model/signature_request_response_data_base.py b/dropbox_sign/model/signature_request_response_data_base.py deleted file mode 100644 index 78a0ffb..0000000 --- a/dropbox_sign/model/signature_request_response_data_base.py +++ /dev/null @@ -1,362 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import SignatureRequestResponseDataValueCheckbox - from dropbox_sign.models import SignatureRequestResponseDataValueCheckboxMerge - from dropbox_sign.models import SignatureRequestResponseDataValueDateSigned - from dropbox_sign.models import SignatureRequestResponseDataValueDropdown - from dropbox_sign.models import SignatureRequestResponseDataValueInitials - from dropbox_sign.models import SignatureRequestResponseDataValueRadio - from dropbox_sign.models import SignatureRequestResponseDataValueSignature - from dropbox_sign.models import SignatureRequestResponseDataValueText - from dropbox_sign.models import SignatureRequestResponseDataValueTextMerge - - -def lazy_import(): - from dropbox_sign.models import SignatureRequestResponseDataValueCheckbox - from dropbox_sign.models import SignatureRequestResponseDataValueCheckboxMerge - from dropbox_sign.models import SignatureRequestResponseDataValueDateSigned - from dropbox_sign.models import SignatureRequestResponseDataValueDropdown - from dropbox_sign.models import SignatureRequestResponseDataValueInitials - from dropbox_sign.models import SignatureRequestResponseDataValueRadio - from dropbox_sign.models import SignatureRequestResponseDataValueSignature - from dropbox_sign.models import SignatureRequestResponseDataValueText - from dropbox_sign.models import SignatureRequestResponseDataValueTextMerge - globals()['SignatureRequestResponseDataValueCheckbox'] = SignatureRequestResponseDataValueCheckbox - globals()['SignatureRequestResponseDataValueCheckboxMerge'] = SignatureRequestResponseDataValueCheckboxMerge - globals()['SignatureRequestResponseDataValueDateSigned'] = SignatureRequestResponseDataValueDateSigned - globals()['SignatureRequestResponseDataValueDropdown'] = SignatureRequestResponseDataValueDropdown - globals()['SignatureRequestResponseDataValueInitials'] = SignatureRequestResponseDataValueInitials - globals()['SignatureRequestResponseDataValueRadio'] = SignatureRequestResponseDataValueRadio - globals()['SignatureRequestResponseDataValueSignature'] = SignatureRequestResponseDataValueSignature - globals()['SignatureRequestResponseDataValueText'] = SignatureRequestResponseDataValueText - globals()['SignatureRequestResponseDataValueTextMerge'] = SignatureRequestResponseDataValueTextMerge - - -class SignatureRequestResponseDataBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': SignatureRequestResponseDataValueCheckbox, - 'checkbox-merge': SignatureRequestResponseDataValueCheckboxMerge, - 'date_signed': SignatureRequestResponseDataValueDateSigned, - 'dropdown': SignatureRequestResponseDataValueDropdown, - 'initials': SignatureRequestResponseDataValueInitials, - 'radio': SignatureRequestResponseDataValueRadio, - 'signature': SignatureRequestResponseDataValueSignature, - 'text': SignatureRequestResponseDataValueText, - 'text-merge': SignatureRequestResponseDataValueTextMerge, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - 'type': 'type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataBase - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataBase - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_response_data_type_enum.py b/dropbox_sign/model/signature_request_response_data_type_enum.py deleted file mode 100644 index 0e1e8ea..0000000 --- a/dropbox_sign/model/signature_request_response_data_type_enum.py +++ /dev/null @@ -1,310 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestResponseDataTypeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'TEXT': "text", - 'CHECKBOX': "checkbox", - 'DATE_SIGNED': "date_signed", - 'DROPDOWN': "dropdown", - 'INITIALS': "initials", - 'RADIO': "radio", - 'SIGNATURE': "signature", - 'TEXT-MERGE': "text-merge", - 'CHECKBOX-MERGE': "checkbox-merge", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataTypeEnum: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataTypeEnum], - _check_type=True, - ) - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """SignatureRequestResponseDataTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["text", "checkbox", "date_signed", "dropdown", "initials", "radio", "signature", "text-merge", "checkbox-merge", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["text", "checkbox", "date_signed", "dropdown", "initials", "radio", "signature", "text-merge", "checkbox-merge", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """SignatureRequestResponseDataTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["text", "checkbox", "date_signed", "dropdown", "initials", "radio", "signature", "text-merge", "checkbox-merge", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["text", "checkbox", "date_signed", "dropdown", "initials", "radio", "signature", "text-merge", "checkbox-merge", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/dropbox_sign/model/signature_request_response_data_value_checkbox.py b/dropbox_sign/model/signature_request_response_data_value_checkbox.py deleted file mode 100644 index 92c8072..0000000 --- a/dropbox_sign/model/signature_request_response_data_value_checkbox.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> bool: - return self.get("value") - - @value.setter - def value(self, value: bool): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueCheckbox - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A yes/no checkbox. [optional] if omitted the server will use the default value of "checkbox" # noqa: E501 - value (bool): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueCheckbox - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A yes/no checkbox. [optional] if omitted the server will use the default value of "checkbox" # noqa: E501 - value (bool): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/signature_request_response_data_value_checkbox_merge.py b/dropbox_sign/model/signature_request_response_data_value_checkbox_merge.py deleted file mode 100644 index 4ca142c..0000000 --- a/dropbox_sign/model/signature_request_response_data_value_checkbox_merge.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueCheckboxMerge(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueCheckboxMerge: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueCheckboxMerge], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueCheckboxMerge - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A checkbox field that has default value set by the api. [optional] if omitted the server will use the default value of "checkbox-merge" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueCheckboxMerge - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A checkbox field that has default value set by the api. [optional] if omitted the server will use the default value of "checkbox-merge" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/signature_request_response_data_value_date_signed.py b/dropbox_sign/model/signature_request_response_data_value_date_signed.py deleted file mode 100644 index 542b950..0000000 --- a/dropbox_sign/model/signature_request_response_data_value_date_signed.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueDateSigned(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueDateSigned: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueDateSigned], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueDateSigned - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A date. [optional] if omitted the server will use the default value of "date_signed" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueDateSigned - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A date. [optional] if omitted the server will use the default value of "date_signed" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/signature_request_response_data_value_dropdown.py b/dropbox_sign/model/signature_request_response_data_value_dropdown.py deleted file mode 100644 index 1168e8f..0000000 --- a/dropbox_sign/model/signature_request_response_data_value_dropdown.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueDropdown(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueDropdown: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueDropdown], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueDropdown - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for dropdowns. [optional] if omitted the server will use the default value of "dropdown" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueDropdown - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for dropdowns. [optional] if omitted the server will use the default value of "dropdown" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/signature_request_response_data_value_initials.py b/dropbox_sign/model/signature_request_response_data_value_initials.py deleted file mode 100644 index bbc7464..0000000 --- a/dropbox_sign/model/signature_request_response_data_value_initials.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueInitials(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueInitials: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueInitials], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueInitials - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for initials. [optional] if omitted the server will use the default value of "initials" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueInitials - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for initials. [optional] if omitted the server will use the default value of "initials" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/signature_request_response_data_value_radio.py b/dropbox_sign/model/signature_request_response_data_value_radio.py deleted file mode 100644 index 37dff05..0000000 --- a/dropbox_sign/model/signature_request_response_data_value_radio.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueRadio(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueRadio: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueRadio], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> bool: - return self.get("value") - - @value.setter - def value(self, value: bool): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueRadio - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for radios. [optional] if omitted the server will use the default value of "radio" # noqa: E501 - value (bool): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueRadio - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): An input field for radios. [optional] if omitted the server will use the default value of "radio" # noqa: E501 - value (bool): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/signature_request_response_data_value_signature.py b/dropbox_sign/model/signature_request_response_data_value_signature.py deleted file mode 100644 index afef513..0000000 --- a/dropbox_sign/model/signature_request_response_data_value_signature.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueSignature(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueSignature: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueSignature], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueSignature - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A signature input field. [optional] if omitted the server will use the default value of "signature" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueSignature - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A signature input field. [optional] if omitted the server will use the default value of "signature" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/signature_request_response_data_value_text.py b/dropbox_sign/model/signature_request_response_data_value_text.py deleted file mode 100644 index 7c2b13f..0000000 --- a/dropbox_sign/model/signature_request_response_data_value_text.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueText - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A text input field. [optional] if omitted the server will use the default value of "text" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueText - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A text input field. [optional] if omitted the server will use the default value of "text" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/signature_request_response_data_value_text_merge.py b/dropbox_sign/model/signature_request_response_data_value_text_merge.py deleted file mode 100644 index 94deb01..0000000 --- a/dropbox_sign/model/signature_request_response_data_value_text_merge.py +++ /dev/null @@ -1,399 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - - -def lazy_import(): - from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase - globals()['SignatureRequestResponseDataBase'] = SignatureRequestResponseDataBase - - -class SignatureRequestResponseDataValueTextMerge(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'signature_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseDataValueTextMerge: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseDataValueTextMerge], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'signature_id': 'signature_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueTextMerge - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A text field that has default text set by the api. [optional] if omitted the server will use the default value of "text-merge" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseDataValueTextMerge - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): A text field that has default text set by the api. [optional] if omitted the server will use the default value of "text-merge" # noqa: E501 - value (str): The value of the form field.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - signature_id (str): The ID of the signature to which this response is linked.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - required (bool): A boolean value denoting if this field is required.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/signature_request_response_signatures.py b/dropbox_sign/model/signature_request_response_signatures.py deleted file mode 100644 index e0f54cd..0000000 --- a/dropbox_sign/model/signature_request_response_signatures.py +++ /dev/null @@ -1,499 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestResponseSignatures(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'signature_id': (str,), # noqa: E501 - 'signer_group_guid': (str, none_type,), # noqa: E501 - 'signer_email_address': (str,), # noqa: E501 - 'signer_name': (str, none_type,), # noqa: E501 - 'signer_role': (str, none_type,), # noqa: E501 - 'order': (int, none_type,), # noqa: E501 - 'status_code': (str,), # noqa: E501 - 'decline_reason': (str, none_type,), # noqa: E501 - 'signed_at': (int, none_type,), # noqa: E501 - 'last_viewed_at': (int, none_type,), # noqa: E501 - 'last_reminded_at': (int, none_type,), # noqa: E501 - 'has_pin': (bool,), # noqa: E501 - 'has_sms_auth': (bool, none_type,), # noqa: E501 - 'has_sms_delivery': (bool, none_type,), # noqa: E501 - 'sms_phone_number': (str, none_type,), # noqa: E501 - 'reassigned_by': (str, none_type,), # noqa: E501 - 'reassignment_reason': (str, none_type,), # noqa: E501 - 'reassigned_from': (str, none_type,), # noqa: E501 - 'error': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestResponseSignatures: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestResponseSignatures], - _check_type=True, - ) - - attribute_map = { - 'signature_id': 'signature_id', # noqa: E501 - 'signer_group_guid': 'signer_group_guid', # noqa: E501 - 'signer_email_address': 'signer_email_address', # noqa: E501 - 'signer_name': 'signer_name', # noqa: E501 - 'signer_role': 'signer_role', # noqa: E501 - 'order': 'order', # noqa: E501 - 'status_code': 'status_code', # noqa: E501 - 'decline_reason': 'decline_reason', # noqa: E501 - 'signed_at': 'signed_at', # noqa: E501 - 'last_viewed_at': 'last_viewed_at', # noqa: E501 - 'last_reminded_at': 'last_reminded_at', # noqa: E501 - 'has_pin': 'has_pin', # noqa: E501 - 'has_sms_auth': 'has_sms_auth', # noqa: E501 - 'has_sms_delivery': 'has_sms_delivery', # noqa: E501 - 'sms_phone_number': 'sms_phone_number', # noqa: E501 - 'reassigned_by': 'reassigned_by', # noqa: E501 - 'reassignment_reason': 'reassignment_reason', # noqa: E501 - 'reassigned_from': 'reassigned_from', # noqa: E501 - 'error': 'error', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def signer_group_guid(self) -> Optional[str]: - return self.get("signer_group_guid") - - @signer_group_guid.setter - def signer_group_guid(self, value: Optional[str]): - setattr(self, "signer_group_guid", value) - - @property - def signer_email_address(self) -> str: - return self.get("signer_email_address") - - @signer_email_address.setter - def signer_email_address(self, value: str): - setattr(self, "signer_email_address", value) - - @property - def signer_name(self) -> Optional[str]: - return self.get("signer_name") - - @signer_name.setter - def signer_name(self, value: Optional[str]): - setattr(self, "signer_name", value) - - @property - def signer_role(self) -> Optional[str]: - return self.get("signer_role") - - @signer_role.setter - def signer_role(self, value: Optional[str]): - setattr(self, "signer_role", value) - - @property - def order(self) -> Optional[int]: - return self.get("order") - - @order.setter - def order(self, value: Optional[int]): - setattr(self, "order", value) - - @property - def status_code(self) -> str: - return self.get("status_code") - - @status_code.setter - def status_code(self, value: str): - setattr(self, "status_code", value) - - @property - def decline_reason(self) -> Optional[str]: - return self.get("decline_reason") - - @decline_reason.setter - def decline_reason(self, value: Optional[str]): - setattr(self, "decline_reason", value) - - @property - def signed_at(self) -> Optional[int]: - return self.get("signed_at") - - @signed_at.setter - def signed_at(self, value: Optional[int]): - setattr(self, "signed_at", value) - - @property - def last_viewed_at(self) -> Optional[int]: - return self.get("last_viewed_at") - - @last_viewed_at.setter - def last_viewed_at(self, value: Optional[int]): - setattr(self, "last_viewed_at", value) - - @property - def last_reminded_at(self) -> Optional[int]: - return self.get("last_reminded_at") - - @last_reminded_at.setter - def last_reminded_at(self, value: Optional[int]): - setattr(self, "last_reminded_at", value) - - @property - def has_pin(self) -> bool: - return self.get("has_pin") - - @has_pin.setter - def has_pin(self, value: bool): - setattr(self, "has_pin", value) - - @property - def has_sms_auth(self) -> Optional[bool]: - return self.get("has_sms_auth") - - @has_sms_auth.setter - def has_sms_auth(self, value: Optional[bool]): - setattr(self, "has_sms_auth", value) - - @property - def has_sms_delivery(self) -> Optional[bool]: - return self.get("has_sms_delivery") - - @has_sms_delivery.setter - def has_sms_delivery(self, value: Optional[bool]): - setattr(self, "has_sms_delivery", value) - - @property - def sms_phone_number(self) -> Optional[str]: - return self.get("sms_phone_number") - - @sms_phone_number.setter - def sms_phone_number(self, value: Optional[str]): - setattr(self, "sms_phone_number", value) - - @property - def reassigned_by(self) -> Optional[str]: - return self.get("reassigned_by") - - @reassigned_by.setter - def reassigned_by(self, value: Optional[str]): - setattr(self, "reassigned_by", value) - - @property - def reassignment_reason(self) -> Optional[str]: - return self.get("reassignment_reason") - - @reassignment_reason.setter - def reassignment_reason(self, value: Optional[str]): - setattr(self, "reassignment_reason", value) - - @property - def reassigned_from(self) -> Optional[str]: - return self.get("reassigned_from") - - @reassigned_from.setter - def reassigned_from(self, value: Optional[str]): - setattr(self, "reassigned_from", value) - - @property - def error(self) -> Optional[str]: - return self.get("error") - - @error.setter - def error(self, value: Optional[str]): - setattr(self, "error", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseSignatures - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_id (str): Signature identifier.. [optional] # noqa: E501 - signer_group_guid (str, none_type): Signer Group GUID. [optional] # noqa: E501 - signer_email_address (str): The email address of the signer.. [optional] # noqa: E501 - signer_name (str, none_type): The name of the signer.. [optional] # noqa: E501 - signer_role (str, none_type): The role of the signer.. [optional] # noqa: E501 - order (int, none_type): If signer order is assigned this is the 0-based index for this signer.. [optional] # noqa: E501 - status_code (str): The current status of the signature. eg: awaiting_signature, signed, declined.. [optional] # noqa: E501 - decline_reason (str, none_type): The reason provided by the signer for declining the request.. [optional] # noqa: E501 - signed_at (int, none_type): Time that the document was signed or null.. [optional] # noqa: E501 - last_viewed_at (int, none_type): The time that the document was last viewed by this signer or null.. [optional] # noqa: E501 - last_reminded_at (int, none_type): The time the last reminder email was sent to the signer or null.. [optional] # noqa: E501 - has_pin (bool): Boolean to indicate whether this signature requires a PIN to access.. [optional] # noqa: E501 - has_sms_auth (bool, none_type): Boolean to indicate whether this signature has SMS authentication enabled.. [optional] # noqa: E501 - has_sms_delivery (bool, none_type): Boolean to indicate whether this signature has SMS delivery enabled.. [optional] # noqa: E501 - sms_phone_number (str, none_type): The SMS phone number used for authentication or signature request delivery.. [optional] # noqa: E501 - reassigned_by (str, none_type): Email address of original signer who reassigned to this signer.. [optional] # noqa: E501 - reassignment_reason (str, none_type): Reason provided by original signer who reassigned to this signer.. [optional] # noqa: E501 - reassigned_from (str, none_type): Previous signature identifier.. [optional] # noqa: E501 - error (str, none_type): Error message pertaining to this signer, or null.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestResponseSignatures - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_id (str): Signature identifier.. [optional] # noqa: E501 - signer_group_guid (str, none_type): Signer Group GUID. [optional] # noqa: E501 - signer_email_address (str): The email address of the signer.. [optional] # noqa: E501 - signer_name (str, none_type): The name of the signer.. [optional] # noqa: E501 - signer_role (str, none_type): The role of the signer.. [optional] # noqa: E501 - order (int, none_type): If signer order is assigned this is the 0-based index for this signer.. [optional] # noqa: E501 - status_code (str): The current status of the signature. eg: awaiting_signature, signed, declined.. [optional] # noqa: E501 - decline_reason (str, none_type): The reason provided by the signer for declining the request.. [optional] # noqa: E501 - signed_at (int, none_type): Time that the document was signed or null.. [optional] # noqa: E501 - last_viewed_at (int, none_type): The time that the document was last viewed by this signer or null.. [optional] # noqa: E501 - last_reminded_at (int, none_type): The time the last reminder email was sent to the signer or null.. [optional] # noqa: E501 - has_pin (bool): Boolean to indicate whether this signature requires a PIN to access.. [optional] # noqa: E501 - has_sms_auth (bool, none_type): Boolean to indicate whether this signature has SMS authentication enabled.. [optional] # noqa: E501 - has_sms_delivery (bool, none_type): Boolean to indicate whether this signature has SMS delivery enabled.. [optional] # noqa: E501 - sms_phone_number (str, none_type): The SMS phone number used for authentication or signature request delivery.. [optional] # noqa: E501 - reassigned_by (str, none_type): Email address of original signer who reassigned to this signer.. [optional] # noqa: E501 - reassignment_reason (str, none_type): Reason provided by original signer who reassigned to this signer.. [optional] # noqa: E501 - reassigned_from (str, none_type): Previous signature identifier.. [optional] # noqa: E501 - error (str, none_type): Error message pertaining to this signer, or null.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_send_request.py b/dropbox_sign/model/signature_request_send_request.py deleted file mode 100644 index ae78605..0000000 --- a/dropbox_sign/model/signature_request_send_request.py +++ /dev/null @@ -1,626 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSignatureRequestGroupedSigners'] = SubSignatureRequestGroupedSigners - globals()['SubSignatureRequestSigner'] = SubSignatureRequestSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestSendRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestSigner],), # noqa: E501 - 'grouped_signers': ([SubSignatureRequestGroupedSigners],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'is_qualified_signature': (bool,), # noqa: E501 - 'is_eid': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestSendRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestSendRequest], - _check_type=True, - ) - - attribute_map = { - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'grouped_signers': 'grouped_signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'is_qualified_signature': 'is_qualified_signature', # noqa: E501 - 'is_eid': 'is_eid', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def signers(self) -> List[SubSignatureRequestSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestSigner]): - setattr(self, "signers", value) - - @property - def grouped_signers(self) -> List[SubSignatureRequestGroupedSigners]: - return self.get("grouped_signers") - - @grouped_signers.setter - def grouped_signers(self, value: List[SubSignatureRequestGroupedSigners]): - setattr(self, "grouped_signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def is_qualified_signature(self) -> bool: - return self.get("is_qualified_signature") - - @is_qualified_signature.setter - def is_qualified_signature(self, value: bool): - setattr(self, "is_qualified_signature", value) - - @property - def is_eid(self) -> bool: - return self.get("is_eid") - - @is_eid.setter - def is_eid(self, value: bool): - setattr(self, "is_eid", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SignatureRequestSendRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SignatureRequestSendRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - signers ([SubSignatureRequestSigner]): Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - grouped_signers ([SubSignatureRequestGroupedSigners]): Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_text_tags (bool): Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_send_with_template_request.py b/dropbox_sign/model/signature_request_send_with_template_request.py deleted file mode 100644 index 63f38d4..0000000 --- a/dropbox_sign/model/signature_request_send_with_template_request.py +++ /dev/null @@ -1,511 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - - -def lazy_import(): - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - from dropbox_sign.model.sub_signing_options import SubSigningOptions - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - globals()['SubSignatureRequestTemplateSigner'] = SubSignatureRequestTemplateSigner - globals()['SubSigningOptions'] = SubSigningOptions - - -class SignatureRequestSendWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_ids': ([str],), # noqa: E501 - 'signers': ([SubSignatureRequestTemplateSigner],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'is_qualified_signature': (bool,), # noqa: E501 - 'is_eid': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestSendWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestSendWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'template_ids': 'template_ids', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'is_qualified_signature': 'is_qualified_signature', # noqa: E501 - 'is_eid': 'is_eid', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def signers(self) -> List[SubSignatureRequestTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestTemplateSigner]): - setattr(self, "signers", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def is_qualified_signature(self) -> bool: - return self.get("is_qualified_signature") - - @is_qualified_signature.setter - def is_qualified_signature(self, value: bool): - setattr(self, "is_qualified_signature", value) - - @property - def is_eid(self) -> bool: - return self.get("is_eid") - - @is_eid.setter - def is_eid(self, value: bool): - setattr(self, "is_eid", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, template_ids, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestSendWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, template_ids, signers, *args, **kwargs): # noqa: E501 - """SignatureRequestSendWithTemplateRequest - a model defined in OpenAPI - - Args: - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - client_id (str): Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - is_qualified_signature (bool): Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_eid (bool): Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.template_ids = template_ids - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/signature_request_update_request.py b/dropbox_sign/model/signature_request_update_request.py deleted file mode 100644 index 2b6f2a6..0000000 --- a/dropbox_sign/model/signature_request_update_request.py +++ /dev/null @@ -1,325 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SignatureRequestUpdateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'signature_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SignatureRequestUpdateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SignatureRequestUpdateRequest], - _check_type=True, - ) - - attribute_map = { - 'signature_id': 'signature_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'name': 'name', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def signature_id(self) -> str: - return self.get("signature_id") - - @signature_id.setter - def signature_id(self, value: str): - setattr(self, "signature_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, signature_id, *args, **kwargs): # noqa: E501 - """SignatureRequestUpdateRequest - a model defined in OpenAPI - - Args: - signature_id (str): The signature ID for the recipient. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided.. [optional] # noqa: E501 - name (str): The new name for the recipient. **NOTE:** Optional if `email_address` is provided.. [optional] # noqa: E501 - expires_at (int, none_type): The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.signature_id = signature_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, signature_id, *args, **kwargs): # noqa: E501 - """SignatureRequestUpdateRequest - a model defined in OpenAPI - - Args: - signature_id (str): The signature ID for the recipient. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided.. [optional] # noqa: E501 - name (str): The new name for the recipient. **NOTE:** Optional if `email_address` is provided.. [optional] # noqa: E501 - expires_at (int, none_type): The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.signature_id = signature_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_attachment.py b/dropbox_sign/model/sub_attachment.py deleted file mode 100644 index 04ed80f..0000000 --- a/dropbox_sign/model/sub_attachment.py +++ /dev/null @@ -1,327 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubAttachment(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'signer_index': (int,), # noqa: E501 - 'instructions': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubAttachment: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubAttachment], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'signer_index': 'signer_index', # noqa: E501 - 'instructions': 'instructions', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer_index(self) -> int: - return self.get("signer_index") - - @signer_index.setter - def signer_index(self, value: int): - setattr(self, "signer_index", value) - - @property - def instructions(self) -> str: - return self.get("instructions") - - @instructions.setter - def instructions(self, value: str): - setattr(self, "instructions", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, signer_index, *args, **kwargs): # noqa: E501 - """SubAttachment - a model defined in OpenAPI - - Args: - name (str): The name of attachment. - signer_index (int): The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - instructions (str): The instructions for uploading the attachment.. [optional] # noqa: E501 - required (bool): Determines if the attachment must be uploaded.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.signer_index = signer_index - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, signer_index, *args, **kwargs): # noqa: E501 - """SubAttachment - a model defined in OpenAPI - - Args: - name (str): The name of attachment. - signer_index (int): The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - instructions (str): The instructions for uploading the attachment.. [optional] # noqa: E501 - required (bool): Determines if the attachment must be uploaded.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.signer_index = signer_index - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_bulk_signer_list.py b/dropbox_sign/model/sub_bulk_signer_list.py deleted file mode 100644 index b4f5157..0000000 --- a/dropbox_sign/model/sub_bulk_signer_list.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - - -def lazy_import(): - from dropbox_sign.model.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField - from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner - globals()['SubBulkSignerListCustomField'] = SubBulkSignerListCustomField - globals()['SubSignatureRequestTemplateSigner'] = SubSignatureRequestTemplateSigner - - -class SubBulkSignerList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'custom_fields': ([SubBulkSignerListCustomField],), # noqa: E501 - 'signers': ([SubSignatureRequestTemplateSigner],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubBulkSignerList: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubBulkSignerList], - _check_type=True, - ) - - attribute_map = { - 'custom_fields': 'custom_fields', # noqa: E501 - 'signers': 'signers', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def custom_fields(self) -> List[SubBulkSignerListCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubBulkSignerListCustomField]): - setattr(self, "custom_fields", value) - - @property - def signers(self) -> List[SubSignatureRequestTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestTemplateSigner]): - setattr(self, "signers", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubBulkSignerList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - custom_fields ([SubBulkSignerListCustomField]): An array of custom field values.. [optional] # noqa: E501 - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubBulkSignerList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - custom_fields ([SubBulkSignerListCustomField]): An array of custom field values.. [optional] # noqa: E501 - signers ([SubSignatureRequestTemplateSigner]): Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_bulk_signer_list_custom_field.py b/dropbox_sign/model/sub_bulk_signer_list_custom_field.py deleted file mode 100644 index 994d55a..0000000 --- a/dropbox_sign/model/sub_bulk_signer_list_custom_field.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubBulkSignerListCustomField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubBulkSignerListCustomField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubBulkSignerListCustomField], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'value': 'value', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, value, *args, **kwargs): # noqa: E501 - """SubBulkSignerListCustomField - a model defined in OpenAPI - - Args: - name (str): The name of the custom field. Must be the field's `name` or `api_id`. - value (str): The value of the custom field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.value = value - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, value, *args, **kwargs): # noqa: E501 - """SubBulkSignerListCustomField - a model defined in OpenAPI - - Args: - name (str): The name of the custom field. Must be the field's `name` or `api_id`. - value (str): The value of the custom field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.value = value - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_cc.py b/dropbox_sign/model/sub_cc.py deleted file mode 100644 index 80ffe2c..0000000 --- a/dropbox_sign/model/sub_cc.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubCC(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'role': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubCC: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubCC], - _check_type=True, - ) - - attribute_map = { - 'role': 'role', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, role, email_address, *args, **kwargs): # noqa: E501 - """SubCC - a model defined in OpenAPI - - Args: - role (str): Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. - email_address (str): The email address of the CC recipient. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, role, email_address, *args, **kwargs): # noqa: E501 - """SubCC - a model defined in OpenAPI - - Args: - role (str): Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. - email_address (str): The email address of the CC recipient. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_custom_field.py b/dropbox_sign/model/sub_custom_field.py deleted file mode 100644 index e6628ee..0000000 --- a/dropbox_sign/model/sub_custom_field.py +++ /dev/null @@ -1,325 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubCustomField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'editor': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'value': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubCustomField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubCustomField], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'editor': 'editor', # noqa: E501 - 'required': 'required', # noqa: E501 - 'value': 'value', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def editor(self) -> str: - return self.get("editor") - - @editor.setter - def editor(self, value: str): - setattr(self, "editor", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """SubCustomField - a model defined in OpenAPI - - Args: - name (str): The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - editor (str): Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable.. [optional] # noqa: E501 - required (bool): Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`.. [optional] if omitted the server will use the default value of False # noqa: E501 - value (str): The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """SubCustomField - a model defined in OpenAPI - - Args: - name (str): The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - editor (str): Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable.. [optional] # noqa: E501 - required (bool): Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`.. [optional] if omitted the server will use the default value of False # noqa: E501 - value (str): The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_editor_options.py b/dropbox_sign/model/sub_editor_options.py deleted file mode 100644 index 0667a7a..0000000 --- a/dropbox_sign/model/sub_editor_options.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubEditorOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'allow_edit_signers': (bool,), # noqa: E501 - 'allow_edit_documents': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubEditorOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubEditorOptions], - _check_type=True, - ) - - attribute_map = { - 'allow_edit_signers': 'allow_edit_signers', # noqa: E501 - 'allow_edit_documents': 'allow_edit_documents', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def allow_edit_signers(self) -> bool: - return self.get("allow_edit_signers") - - @allow_edit_signers.setter - def allow_edit_signers(self, value: bool): - setattr(self, "allow_edit_signers", value) - - @property - def allow_edit_documents(self) -> bool: - return self.get("allow_edit_documents") - - @allow_edit_documents.setter - def allow_edit_documents(self, value: bool): - setattr(self, "allow_edit_documents", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubEditorOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_edit_signers (bool): Allows requesters to edit the list of signers. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_edit_documents (bool): Allows requesters to edit documents, including delete and add. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubEditorOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_edit_signers (bool): Allows requesters to edit the list of signers. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_edit_documents (bool): Allows requesters to edit documents, including delete and add. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_field_options.py b/dropbox_sign/model/sub_field_options.py deleted file mode 100644 index 39b35c4..0000000 --- a/dropbox_sign/model/sub_field_options.py +++ /dev/null @@ -1,297 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFieldOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('date_format',): { - 'MMDDYYYY': "MM / DD / YYYY", - 'MM_DD_YYYY': "MM - DD - YYYY", - 'DDMMYYYY': "DD / MM / YYYY", - 'DD_MM_YYYY': "DD - MM - YYYY", - 'YYYYMMDD': "YYYY / MM / DD", - 'YYYY_MM_DD': "YYYY - MM - DD", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'date_format': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFieldOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFieldOptions], - _check_type=True, - ) - - attribute_map = { - 'date_format': 'date_format', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def date_format(self) -> str: - return self.get("date_format") - - @date_format.setter - def date_format(self, value: str): - setattr(self, "date_format", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, date_format, *args, **kwargs): # noqa: E501 - """SubFieldOptions - a model defined in OpenAPI - - Args: - date_format (str): Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.date_format = date_format - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, date_format, *args, **kwargs): # noqa: E501 - """SubFieldOptions - a model defined in OpenAPI - - Args: - date_format (str): Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.date_format = date_format - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_form_field_group.py b/dropbox_sign/model/sub_form_field_group.py deleted file mode 100644 index eee79a8..0000000 --- a/dropbox_sign/model/sub_form_field_group.py +++ /dev/null @@ -1,317 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFormFieldGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'group_id': (str,), # noqa: E501 - 'group_label': (str,), # noqa: E501 - 'requirement': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldGroup: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldGroup], - _check_type=True, - ) - - attribute_map = { - 'group_id': 'group_id', # noqa: E501 - 'group_label': 'group_label', # noqa: E501 - 'requirement': 'requirement', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def group_id(self) -> str: - return self.get("group_id") - - @group_id.setter - def group_id(self, value: str): - setattr(self, "group_id", value) - - @property - def group_label(self) -> str: - return self.get("group_label") - - @group_label.setter - def group_label(self, value: str): - setattr(self, "group_label", value) - - @property - def requirement(self) -> str: - return self.get("requirement") - - @requirement.setter - def requirement(self, value: str): - setattr(self, "requirement", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, group_id, group_label, requirement, *args, **kwargs): # noqa: E501 - """SubFormFieldGroup - a model defined in OpenAPI - - Args: - group_id (str): ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. - group_label (str): Name of the group - requirement (str): Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.group_id = group_id - self.group_label = group_label - self.requirement = requirement - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, group_id, group_label, requirement, *args, **kwargs): # noqa: E501 - """SubFormFieldGroup - a model defined in OpenAPI - - Args: - group_id (str): ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. - group_label (str): Name of the group - requirement (str): Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.group_id = group_id - self.group_label = group_label - self.requirement = requirement - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_form_field_rule.py b/dropbox_sign/model/sub_form_field_rule.py deleted file mode 100644 index 6b3833c..0000000 --- a/dropbox_sign/model/sub_form_field_rule.py +++ /dev/null @@ -1,351 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_field_rule_action import SubFormFieldRuleAction - from dropbox_sign.model.sub_form_field_rule_trigger import SubFormFieldRuleTrigger - - -def lazy_import(): - from dropbox_sign.model.sub_form_field_rule_action import SubFormFieldRuleAction - from dropbox_sign.model.sub_form_field_rule_trigger import SubFormFieldRuleTrigger - globals()['SubFormFieldRuleAction'] = SubFormFieldRuleAction - globals()['SubFormFieldRuleTrigger'] = SubFormFieldRuleTrigger - - -class SubFormFieldRule(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('triggers',): { - 'max_items': 1, - 'min_items': 1, - }, - ('actions',): { - 'min_items': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'id': (str,), # noqa: E501 - 'trigger_operator': (str,), # noqa: E501 - 'triggers': ([SubFormFieldRuleTrigger],), # noqa: E501 - 'actions': ([SubFormFieldRuleAction],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldRule: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldRule], - _check_type=True, - ) - - attribute_map = { - 'id': 'id', # noqa: E501 - 'trigger_operator': 'trigger_operator', # noqa: E501 - 'triggers': 'triggers', # noqa: E501 - 'actions': 'actions', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def id(self) -> str: - return self.get("id") - - @id.setter - def id(self, value: str): - setattr(self, "id", value) - - @property - def trigger_operator(self) -> str: - return self.get("trigger_operator") - - @trigger_operator.setter - def trigger_operator(self, value: str): - setattr(self, "trigger_operator", value) - - @property - def triggers(self) -> List[SubFormFieldRuleTrigger]: - return self.get("triggers") - - @triggers.setter - def triggers(self, value: List[SubFormFieldRuleTrigger]): - setattr(self, "triggers", value) - - @property - def actions(self) -> List[SubFormFieldRuleAction]: - return self.get("actions") - - @actions.setter - def actions(self, value: List[SubFormFieldRuleAction]): - setattr(self, "actions", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, id, triggers, actions, *args, **kwargs): # noqa: E501 - """SubFormFieldRule - a model defined in OpenAPI - - Args: - id (str): Must be unique across all defined rules. - triggers ([SubFormFieldRuleTrigger]): An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. - actions ([SubFormFieldRuleAction]): An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule. - - Keyword Args: - trigger_operator (str): Currently only `AND` is supported. Support for `OR` is being worked on.. defaults to "AND" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - trigger_operator = kwargs.get('trigger_operator', "AND") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.trigger_operator = trigger_operator - self.triggers = triggers - self.actions = actions - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, id, triggers, actions, *args, **kwargs): # noqa: E501 - """SubFormFieldRule - a model defined in OpenAPI - - Args: - id (str): Must be unique across all defined rules. - triggers ([SubFormFieldRuleTrigger]): An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. - actions ([SubFormFieldRuleAction]): An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule. - - Keyword Args: - trigger_operator (str): Currently only `AND` is supported. Support for `OR` is being worked on.. defaults to "AND" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - trigger_operator = kwargs.get('trigger_operator', "AND") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.trigger_operator = trigger_operator - self.triggers = triggers - self.actions = actions - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_form_field_rule_action.py b/dropbox_sign/model/sub_form_field_rule_action.py deleted file mode 100644 index d3b0845..0000000 --- a/dropbox_sign/model/sub_form_field_rule_action.py +++ /dev/null @@ -1,331 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFormFieldRuleAction(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'FIELD-VISIBILITY': "change-field-visibility", - 'GROUP-VISIBILITY': "change-group-visibility", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'hidden': (bool,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'field_id': (str,), # noqa: E501 - 'group_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldRuleAction: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldRuleAction], - _check_type=True, - ) - - attribute_map = { - 'hidden': 'hidden', # noqa: E501 - 'type': 'type', # noqa: E501 - 'field_id': 'field_id', # noqa: E501 - 'group_id': 'group_id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def hidden(self) -> bool: - return self.get("hidden") - - @hidden.setter - def hidden(self, value: bool): - setattr(self, "hidden", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def field_id(self) -> str: - return self.get("field_id") - - @field_id.setter - def field_id(self, value: str): - setattr(self, "field_id", value) - - @property - def group_id(self) -> str: - return self.get("group_id") - - @group_id.setter - def group_id(self, value: str): - setattr(self, "group_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, hidden, type, *args, **kwargs): # noqa: E501 - """SubFormFieldRuleAction - a model defined in OpenAPI - - Args: - hidden (bool): `true` to hide the target field when rule is satisfied, otherwise `false`. - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - field_id (str): **field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer.. [optional] # noqa: E501 - group_id (str): **group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.hidden = hidden - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, hidden, type, *args, **kwargs): # noqa: E501 - """SubFormFieldRuleAction - a model defined in OpenAPI - - Args: - hidden (bool): `true` to hide the target field when rule is satisfied, otherwise `false`. - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - field_id (str): **field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer.. [optional] # noqa: E501 - group_id (str): **group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.hidden = hidden - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_form_field_rule_trigger.py b/dropbox_sign/model/sub_form_field_rule_trigger.py deleted file mode 100644 index 73e918e..0000000 --- a/dropbox_sign/model/sub_form_field_rule_trigger.py +++ /dev/null @@ -1,334 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFormFieldRuleTrigger(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('operator',): { - 'ANY': "any", - 'IS': "is", - 'MATCH': "match", - 'NONE': "none", - 'NOT': "not", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'id': (str,), # noqa: E501 - 'operator': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'values': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldRuleTrigger: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldRuleTrigger], - _check_type=True, - ) - - attribute_map = { - 'id': 'id', # noqa: E501 - 'operator': 'operator', # noqa: E501 - 'value': 'value', # noqa: E501 - 'values': 'values', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def id(self) -> str: - return self.get("id") - - @id.setter - def id(self, value: str): - setattr(self, "id", value) - - @property - def operator(self) -> str: - return self.get("operator") - - @operator.setter - def operator(self, value: str): - setattr(self, "operator", value) - - @property - def value(self) -> str: - return self.get("value") - - @value.setter - def value(self, value: str): - setattr(self, "value", value) - - @property - def values(self) -> List[str]: - return self.get("values") - - @values.setter - def values(self, value: List[str]): - setattr(self, "values", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, id, operator, *args, **kwargs): # noqa: E501 - """SubFormFieldRuleTrigger - a model defined in OpenAPI - - Args: - id (str): Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. - operator (str): Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (str): **value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1`. [optional] # noqa: E501 - values ([str]): **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none`. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.operator = operator - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, id, operator, *args, **kwargs): # noqa: E501 - """SubFormFieldRuleTrigger - a model defined in OpenAPI - - Args: - id (str): Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer. - operator (str): Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - value (str): **value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1`. [optional] # noqa: E501 - values ([str]): **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none`. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.operator = operator - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_form_fields_per_document_base.py b/dropbox_sign/model/sub_form_fields_per_document_base.py deleted file mode 100644 index 405e8fa..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_base.py +++ /dev/null @@ -1,460 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import SubFormFieldsPerDocumentCheckbox - from dropbox_sign.models import SubFormFieldsPerDocumentCheckboxMerge - from dropbox_sign.models import SubFormFieldsPerDocumentDateSigned - from dropbox_sign.models import SubFormFieldsPerDocumentDropdown - from dropbox_sign.models import SubFormFieldsPerDocumentHyperlink - from dropbox_sign.models import SubFormFieldsPerDocumentInitials - from dropbox_sign.models import SubFormFieldsPerDocumentRadio - from dropbox_sign.models import SubFormFieldsPerDocumentSignature - from dropbox_sign.models import SubFormFieldsPerDocumentText - from dropbox_sign.models import SubFormFieldsPerDocumentTextMerge - - -def lazy_import(): - from dropbox_sign.models import SubFormFieldsPerDocumentCheckbox - from dropbox_sign.models import SubFormFieldsPerDocumentCheckboxMerge - from dropbox_sign.models import SubFormFieldsPerDocumentDateSigned - from dropbox_sign.models import SubFormFieldsPerDocumentDropdown - from dropbox_sign.models import SubFormFieldsPerDocumentHyperlink - from dropbox_sign.models import SubFormFieldsPerDocumentInitials - from dropbox_sign.models import SubFormFieldsPerDocumentRadio - from dropbox_sign.models import SubFormFieldsPerDocumentSignature - from dropbox_sign.models import SubFormFieldsPerDocumentText - from dropbox_sign.models import SubFormFieldsPerDocumentTextMerge - globals()['SubFormFieldsPerDocumentCheckbox'] = SubFormFieldsPerDocumentCheckbox - globals()['SubFormFieldsPerDocumentCheckboxMerge'] = SubFormFieldsPerDocumentCheckboxMerge - globals()['SubFormFieldsPerDocumentDateSigned'] = SubFormFieldsPerDocumentDateSigned - globals()['SubFormFieldsPerDocumentDropdown'] = SubFormFieldsPerDocumentDropdown - globals()['SubFormFieldsPerDocumentHyperlink'] = SubFormFieldsPerDocumentHyperlink - globals()['SubFormFieldsPerDocumentInitials'] = SubFormFieldsPerDocumentInitials - globals()['SubFormFieldsPerDocumentRadio'] = SubFormFieldsPerDocumentRadio - globals()['SubFormFieldsPerDocumentSignature'] = SubFormFieldsPerDocumentSignature - globals()['SubFormFieldsPerDocumentText'] = SubFormFieldsPerDocumentText - globals()['SubFormFieldsPerDocumentTextMerge'] = SubFormFieldsPerDocumentTextMerge - - -class SubFormFieldsPerDocumentBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': SubFormFieldsPerDocumentCheckbox, - 'checkbox-merge': SubFormFieldsPerDocumentCheckboxMerge, - 'date_signed': SubFormFieldsPerDocumentDateSigned, - 'dropdown': SubFormFieldsPerDocumentDropdown, - 'hyperlink': SubFormFieldsPerDocumentHyperlink, - 'initials': SubFormFieldsPerDocumentInitials, - 'radio': SubFormFieldsPerDocumentRadio, - 'signature': SubFormFieldsPerDocumentSignature, - 'text': SubFormFieldsPerDocumentText, - 'text-merge': SubFormFieldsPerDocumentTextMerge, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'type': 'type', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, document_index, api_id, height, required, signer, type, width, x, y, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentBase - a model defined in OpenAPI - - Args: - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - type (str): - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.document_index = document_index - self.api_id = api_id - self.height = height - self.required = required - self.signer = signer - self.type = type - self.width = width - self.x = x - self.y = y - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, document_index, api_id, height, required, signer, type, width, x, y, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentBase - a model defined in OpenAPI - - Args: - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - type (str): - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.document_index = document_index - self.api_id = api_id - self.height = height - self.required = required - self.signer = signer - self.type = type - self.width = width - self.x = x - self.y = y - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_form_fields_per_document_checkbox.py b/dropbox_sign/model/sub_form_fields_per_document_checkbox.py deleted file mode 100644 index 8430d4a..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_checkbox.py +++ /dev/null @@ -1,485 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'is_checked': (bool,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'group': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'is_checked': 'is_checked', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'group': 'group', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def is_checked(self) -> bool: - return self.get("is_checked") - - @is_checked.setter - def is_checked(self, value: bool): - setattr(self, "is_checked", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def group(self) -> str: - return self.get("group") - - @group.setter - def group(self, value: str): - setattr(self, "group", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class.. defaults to "checkbox" # noqa: E501 - is_checked (bool): `true` for checking the checkbox field by default, otherwise `false`. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - group (str): String referencing group defined in `form_field_groups` parameter.. [optional] # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class.. defaults to "checkbox" # noqa: E501 - is_checked (bool): `true` for checking the checkbox field by default, otherwise `false`. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - group (str): String referencing group defined in `form_field_groups` parameter.. [optional] # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/sub_form_fields_per_document_checkbox_merge.py b/dropbox_sign/model/sub_form_fields_per_document_checkbox_merge.py deleted file mode 100644 index 29263c0..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_checkbox_merge.py +++ /dev/null @@ -1,461 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentCheckboxMerge(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentCheckboxMerge: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentCheckboxMerge], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentCheckboxMerge - a model defined in OpenAPI - - Keyword Args: - type (str): A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class.. defaults to "checkbox-merge" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox-merge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentCheckboxMerge - a model defined in OpenAPI - - Keyword Args: - type (str): A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class.. defaults to "checkbox-merge" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox-merge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/sub_form_fields_per_document_date_signed.py b/dropbox_sign/model/sub_form_fields_per_document_date_signed.py deleted file mode 100644 index ec103c3..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_date_signed.py +++ /dev/null @@ -1,503 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentDateSigned(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('font_family',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'font_size': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentDateSigned: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentDateSigned], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'font_family': 'font_family', # noqa: E501 - 'font_size': 'font_size', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def font_size(self) -> int: - return self.get("font_size") - - @font_size.setter - def font_size(self, value: int): - setattr(self, "font_size", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): A date. Use the `SubFormFieldsPerDocumentDateSigned` class.. defaults to "date_signed" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): A date. Use the `SubFormFieldsPerDocumentDateSigned` class.. defaults to "date_signed" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/sub_form_fields_per_document_dropdown.py b/dropbox_sign/model/sub_form_fields_per_document_dropdown.py deleted file mode 100644 index 589f3b5..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_dropdown.py +++ /dev/null @@ -1,530 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentDropdown(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('font_family',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - ('options',): { - 'min_items': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'options': ([str],), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'content': (str,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'font_size': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentDropdown: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentDropdown], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'options': 'options', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'content': 'content', # noqa: E501 - 'font_family': 'font_family', # noqa: E501 - 'font_size': 'font_size', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def options(self) -> List[str]: - return self.get("options") - - @options.setter - def options(self, value: List[str]): - setattr(self, "options", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def content(self) -> str: - return self.get("content") - - @content.setter - def content(self, value: str): - setattr(self, "content", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def font_size(self) -> int: - return self.get("font_size") - - @font_size.setter - def font_size(self, value: int): - setattr(self, "font_size", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class.. defaults to "dropdown" # noqa: E501 - options ([str]): Array of string values representing dropdown values. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - content (str): Selected value in `options` array. Value must exist in array.. [optional] # noqa: E501 - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class.. defaults to "dropdown" # noqa: E501 - options ([str]): Array of string values representing dropdown values. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - content (str): Selected value in `options` array. Value must exist in array.. [optional] # noqa: E501 - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/sub_form_fields_per_document_font_enum.py b/dropbox_sign/model/sub_form_fields_per_document_font_enum.py deleted file mode 100644 index 5cb12da..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_font_enum.py +++ /dev/null @@ -1,317 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFormFieldsPerDocumentFontEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentFontEnum: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentFontEnum], - _check_type=True, - ) - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """SubFormFieldsPerDocumentFontEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """SubFormFieldsPerDocumentFontEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/dropbox_sign/model/sub_form_fields_per_document_hyperlink.py b/dropbox_sign/model/sub_form_fields_per_document_hyperlink.py deleted file mode 100644 index 0de905f..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_hyperlink.py +++ /dev/null @@ -1,527 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentHyperlink(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('font_family',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'content': (str,), # noqa: E501 - 'content_url': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'font_size': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentHyperlink: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentHyperlink], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'content': 'content', # noqa: E501 - 'content_url': 'content_url', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'font_family': 'font_family', # noqa: E501 - 'font_size': 'font_size', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def content(self) -> str: - return self.get("content") - - @content.setter - def content(self, value: str): - setattr(self, "content", value) - - @property - def content_url(self) -> str: - return self.get("content_url") - - @content_url.setter - def content_url(self, value: str): - setattr(self, "content_url", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def font_size(self) -> int: - return self.get("font_size") - - @font_size.setter - def font_size(self, value: int): - setattr(self, "font_size", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class.. defaults to "hyperlink" # noqa: E501 - content (str): Link Text. - content_url (str): Link URL. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class.. defaults to "hyperlink" # noqa: E501 - content (str): Link Text. - content_url (str): Link URL. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/sub_form_fields_per_document_initials.py b/dropbox_sign/model/sub_form_fields_per_document_initials.py deleted file mode 100644 index 174ac3d..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_initials.py +++ /dev/null @@ -1,461 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentInitials(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentInitials: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentInitials], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentInitials - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class.. defaults to "initials" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentInitials - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class.. defaults to "initials" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/sub_form_fields_per_document_radio.py b/dropbox_sign/model/sub_form_fields_per_document_radio.py deleted file mode 100644 index 8ba630d..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_radio.py +++ /dev/null @@ -1,485 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentRadio(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'group': (str,), # noqa: E501 - 'is_checked': (bool,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentRadio: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentRadio], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'group': 'group', # noqa: E501 - 'is_checked': 'is_checked', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def group(self) -> str: - return self.get("group") - - @group.setter - def group(self, value: str): - setattr(self, "group", value) - - @property - def is_checked(self) -> bool: - return self.get("is_checked") - - @is_checked.setter - def is_checked(self, value: bool): - setattr(self, "is_checked", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentRadio - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class.. defaults to "radio" # noqa: E501 - group (str): String referencing group defined in `form_field_groups` parameter. - is_checked (bool): `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentRadio - a model defined in OpenAPI - - Keyword Args: - type (str): An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class.. defaults to "radio" # noqa: E501 - group (str): String referencing group defined in `form_field_groups` parameter. - is_checked (bool): `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/sub_form_fields_per_document_signature.py b/dropbox_sign/model/sub_form_fields_per_document_signature.py deleted file mode 100644 index 6eb9fd3..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_signature.py +++ /dev/null @@ -1,461 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentSignature(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentSignature: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentSignature], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentSignature - a model defined in OpenAPI - - Keyword Args: - type (str): A signature input field. Use the `SubFormFieldsPerDocumentSignature` class.. defaults to "signature" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentSignature - a model defined in OpenAPI - - Keyword Args: - type (str): A signature input field. Use the `SubFormFieldsPerDocumentSignature` class.. defaults to "signature" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/sub_form_fields_per_document_text.py b/dropbox_sign/model/sub_form_fields_per_document_text.py deleted file mode 100644 index 41dc913..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_text.py +++ /dev/null @@ -1,611 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('validation_type',): { - 'NUMBERS_ONLY': "numbers_only", - 'LETTERS_ONLY': "letters_only", - 'PHONE_NUMBER': "phone_number", - 'BANK_ROUTING_NUMBER': "bank_routing_number", - 'BANK_ACCOUNT_NUMBER': "bank_account_number", - 'EMAIL_ADDRESS': "email_address", - 'ZIP_CODE': "zip_code", - 'SOCIAL_SECURITY_NUMBER': "social_security_number", - 'EMPLOYER_IDENTIFICATION_NUMBER': "employer_identification_number", - 'CUSTOM_REGEX': "custom_regex", - }, - ('font_family',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'placeholder': (str,), # noqa: E501 - 'auto_fill_type': (str,), # noqa: E501 - 'link_id': (str,), # noqa: E501 - 'masked': (bool,), # noqa: E501 - 'validation_type': (str,), # noqa: E501 - 'validation_custom_regex': (str,), # noqa: E501 - 'validation_custom_regex_format_label': (str,), # noqa: E501 - 'content': (str,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'font_size': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'placeholder': 'placeholder', # noqa: E501 - 'auto_fill_type': 'auto_fill_type', # noqa: E501 - 'link_id': 'link_id', # noqa: E501 - 'masked': 'masked', # noqa: E501 - 'validation_type': 'validation_type', # noqa: E501 - 'validation_custom_regex': 'validation_custom_regex', # noqa: E501 - 'validation_custom_regex_format_label': 'validation_custom_regex_format_label', # noqa: E501 - 'content': 'content', # noqa: E501 - 'font_family': 'font_family', # noqa: E501 - 'font_size': 'font_size', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def placeholder(self) -> str: - return self.get("placeholder") - - @placeholder.setter - def placeholder(self, value: str): - setattr(self, "placeholder", value) - - @property - def auto_fill_type(self) -> str: - return self.get("auto_fill_type") - - @auto_fill_type.setter - def auto_fill_type(self, value: str): - setattr(self, "auto_fill_type", value) - - @property - def link_id(self) -> str: - return self.get("link_id") - - @link_id.setter - def link_id(self, value: str): - setattr(self, "link_id", value) - - @property - def masked(self) -> bool: - return self.get("masked") - - @masked.setter - def masked(self, value: bool): - setattr(self, "masked", value) - - @property - def validation_type(self) -> str: - return self.get("validation_type") - - @validation_type.setter - def validation_type(self, value: str): - setattr(self, "validation_type", value) - - @property - def validation_custom_regex(self) -> str: - return self.get("validation_custom_regex") - - @validation_custom_regex.setter - def validation_custom_regex(self, value: str): - setattr(self, "validation_custom_regex", value) - - @property - def validation_custom_regex_format_label(self) -> str: - return self.get("validation_custom_regex_format_label") - - @validation_custom_regex_format_label.setter - def validation_custom_regex_format_label(self, value: str): - setattr(self, "validation_custom_regex_format_label", value) - - @property - def content(self) -> str: - return self.get("content") - - @content.setter - def content(self, value: str): - setattr(self, "content", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def font_size(self) -> int: - return self.get("font_size") - - @font_size.setter - def font_size(self, value: int): - setattr(self, "font_size", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentText - a model defined in OpenAPI - - Keyword Args: - type (str): A text input field. Use the `SubFormFieldsPerDocumentText` class.. defaults to "text" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - placeholder (str): Placeholder value for text field.. [optional] # noqa: E501 - auto_fill_type (str): Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values.. [optional] # noqa: E501 - link_id (str): Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields.. [optional] # noqa: E501 - masked (bool): Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`.. [optional] # noqa: E501 - validation_type (str): Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value.. [optional] # noqa: E501 - validation_custom_regex (str): [optional] # noqa: E501 - validation_custom_regex_format_label (str): [optional] # noqa: E501 - content (str): Content of a `me_now` text field. [optional] # noqa: E501 - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentText - a model defined in OpenAPI - - Keyword Args: - type (str): A text input field. Use the `SubFormFieldsPerDocumentText` class.. defaults to "text" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - placeholder (str): Placeholder value for text field.. [optional] # noqa: E501 - auto_fill_type (str): Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values.. [optional] # noqa: E501 - link_id (str): Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields.. [optional] # noqa: E501 - masked (bool): Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`.. [optional] # noqa: E501 - validation_type (str): Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value.. [optional] # noqa: E501 - validation_custom_regex (str): [optional] # noqa: E501 - validation_custom_regex_format_label (str): [optional] # noqa: E501 - content (str): Content of a `me_now` text field. [optional] # noqa: E501 - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/sub_form_fields_per_document_text_merge.py b/dropbox_sign/model/sub_form_fields_per_document_text_merge.py deleted file mode 100644 index 28c1bdc..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_text_merge.py +++ /dev/null @@ -1,503 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - - -def lazy_import(): - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - - -class SubFormFieldsPerDocumentTextMerge(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('font_family',): { - 'HELVETICA': "helvetica", - 'ARIAL': "arial", - 'COURIER': "courier", - 'CALIBRI': "calibri", - 'CAMBRIA': "cambria", - 'GEORGIA': "georgia", - 'TIMES': "times", - 'TREBUCHET': "trebuchet", - 'VERDANA': "verdana", - 'ROBOTO': "roboto", - 'ROBOTOMONO': "robotoMono", - 'NOTOSANS': "notoSans", - 'NOTOSERIF': "notoSerif", - 'NOTOCJK-JP-REGULAR': "notoCJK-JP-Regular", - 'NOTOHEBREW-REGULAR': "notoHebrew-Regular", - 'NOTOSANTHAIMERGED': "notoSanThaiMerged", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'document_index': (int,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'signer': (int, str,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'font_size': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'page': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentTextMerge: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentTextMerge], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'document_index': 'document_index', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'width': 'width', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'font_family': 'font_family', # noqa: E501 - 'font_size': 'font_size', # noqa: E501 - 'name': 'name', # noqa: E501 - 'page': 'page', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def document_index(self) -> int: - return self.get("document_index") - - @document_index.setter - def document_index(self, value: int): - setattr(self, "document_index", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def signer(self) -> Union[int, str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Union[int, str]): - setattr(self, "signer", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def font_size(self) -> int: - return self.get("font_size") - - @font_size.setter - def font_size(self, value: int): - setattr(self, "font_size", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def page(self) -> Optional[int]: - return self.get("page") - - @page.setter - def page(self, value: Optional[int]): - setattr(self, "page", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentTextMerge - a model defined in OpenAPI - - Keyword Args: - type (str): A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class.. defaults to "text-merge" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text-merge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubFormFieldsPerDocumentTextMerge - a model defined in OpenAPI - - Keyword Args: - type (str): A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class.. defaults to "text-merge" # noqa: E501 - document_index (int): Represents the integer index of the `file` or `file_url` document the field should be attached to. - api_id (str): An identifier for the field that is unique across all documents in the request. - height (int): Size of the field in pixels. - required (bool): Whether this field is required. - signer (str|int): Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data. - width (int): Size of the field in pixels. - x (int): Location coordinates of the field in pixels. - y (int): Location coordinates of the field in pixels. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - font_family (str): Font family for the field.. [optional] # noqa: E501 - font_size (int): The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.. [optional] if omitted the server will use the default value of 12 # noqa: E501 - name (str): Display name for the field.. [optional] # noqa: E501 - page (int, none_type): Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text-merge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/sub_form_fields_per_document_type_enum.py b/dropbox_sign/model/sub_form_fields_per_document_type_enum.py deleted file mode 100644 index 163d052..0000000 --- a/dropbox_sign/model/sub_form_fields_per_document_type_enum.py +++ /dev/null @@ -1,311 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubFormFieldsPerDocumentTypeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'CHECKBOX': "checkbox", - 'CHECKBOX-MERGE': "checkbox-merge", - 'DATE_SIGNED': "date_signed", - 'DROPDOWN': "dropdown", - 'HYPERLINK': "hyperlink", - 'INITIALS': "initials", - 'SIGNATURE': "signature", - 'RADIO': "radio", - 'TEXT': "text", - 'TEXT-MERGE': "text-merge", - }, - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'value': (str,), - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubFormFieldsPerDocumentTypeEnum: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubFormFieldsPerDocumentTypeEnum], - _check_type=True, - ) - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """SubFormFieldsPerDocumentTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["checkbox", "checkbox-merge", "date_signed", "dropdown", "hyperlink", "initials", "signature", "radio", "text", "text-merge", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["checkbox", "checkbox-merge", "date_signed", "dropdown", "hyperlink", "initials", "signature", "radio", "text", "text-merge", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """SubFormFieldsPerDocumentTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["checkbox", "checkbox-merge", "date_signed", "dropdown", "hyperlink", "initials", "signature", "radio", "text", "text-merge", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["checkbox", "checkbox-merge", "date_signed", "dropdown", "hyperlink", "initials", "signature", "radio", "text", "text-merge", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/dropbox_sign/model/sub_merge_field.py b/dropbox_sign/model/sub_merge_field.py deleted file mode 100644 index efe798b..0000000 --- a/dropbox_sign/model/sub_merge_field.py +++ /dev/null @@ -1,307 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubMergeField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TEXT': "text", - 'CHECKBOX': "checkbox", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubMergeField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubMergeField], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'type': 'type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, type, *args, **kwargs): # noqa: E501 - """SubMergeField - a model defined in OpenAPI - - Args: - name (str): The name of the merge field. Must be unique. - type (str): The type of merge field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, type, *args, **kwargs): # noqa: E501 - """SubMergeField - a model defined in OpenAPI - - Args: - name (str): The name of the merge field. Must be unique. - type (str): The type of merge field. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_o_auth.py b/dropbox_sign/model/sub_o_auth.py deleted file mode 100644 index bbcf95a..0000000 --- a/dropbox_sign/model/sub_o_auth.py +++ /dev/null @@ -1,305 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubOAuth(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('scopes',): { - 'REQUEST_SIGNATURE': "request_signature", - 'BASIC_ACCOUNT_INFO': "basic_account_info", - 'ACCOUNT_ACCESS': "account_access", - 'SIGNATURE_REQUEST_ACCESS': "signature_request_access", - 'TEMPLATE_ACCESS': "template_access", - 'TEAM_ACCESS': "team_access", - 'API_APP_ACCESS': "api_app_access", - 'EMPTY': "", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'callback_url': (str,), # noqa: E501 - 'scopes': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubOAuth: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubOAuth], - _check_type=True, - ) - - attribute_map = { - 'callback_url': 'callback_url', # noqa: E501 - 'scopes': 'scopes', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def callback_url(self) -> str: - return self.get("callback_url") - - @callback_url.setter - def callback_url(self, value: str): - setattr(self, "callback_url", value) - - @property - def scopes(self) -> List[str]: - return self.get("scopes") - - @scopes.setter - def scopes(self, value: List[str]): - setattr(self, "scopes", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubOAuth - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided). [optional] # noqa: E501 - scopes ([str]): A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubOAuth - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - callback_url (str): The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided). [optional] # noqa: E501 - scopes ([str]): A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_options.py b/dropbox_sign/model/sub_options.py deleted file mode 100644 index 459b44a..0000000 --- a/dropbox_sign/model/sub_options.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'can_insert_everywhere': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubOptions], - _check_type=True, - ) - - attribute_map = { - 'can_insert_everywhere': 'can_insert_everywhere', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def can_insert_everywhere(self) -> bool: - return self.get("can_insert_everywhere") - - @can_insert_everywhere.setter - def can_insert_everywhere(self, value: bool): - setattr(self, "can_insert_everywhere", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - can_insert_everywhere (bool): Determines if signers can use \"Insert Everywhere\" when signing a document.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - can_insert_everywhere (bool): Determines if signers can use \"Insert Everywhere\" when signing a document.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_signature_request_grouped_signers.py b/dropbox_sign/model/sub_signature_request_grouped_signers.py deleted file mode 100644 index 168ed32..0000000 --- a/dropbox_sign/model/sub_signature_request_grouped_signers.py +++ /dev/null @@ -1,323 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - - -def lazy_import(): - from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner - globals()['SubSignatureRequestSigner'] = SubSignatureRequestSigner - - -class SubSignatureRequestGroupedSigners(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'group': (str,), # noqa: E501 - 'signers': ([SubSignatureRequestSigner],), # noqa: E501 - 'order': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubSignatureRequestGroupedSigners: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubSignatureRequestGroupedSigners], - _check_type=True, - ) - - attribute_map = { - 'group': 'group', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'order': 'order', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def group(self) -> str: - return self.get("group") - - @group.setter - def group(self, value: str): - setattr(self, "group", value) - - @property - def signers(self) -> List[SubSignatureRequestSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubSignatureRequestSigner]): - setattr(self, "signers", value) - - @property - def order(self) -> Optional[int]: - return self.get("order") - - @order.setter - def order(self, value: Optional[int]): - setattr(self, "order", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, group, signers, *args, **kwargs): # noqa: E501 - """SubSignatureRequestGroupedSigners - a model defined in OpenAPI - - Args: - group (str): The name of the group. - signers ([SubSignatureRequestSigner]): Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the group is required to sign in. Use this instead of Signer-level `order`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.group = group - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, group, signers, *args, **kwargs): # noqa: E501 - """SubSignatureRequestGroupedSigners - a model defined in OpenAPI - - Args: - group (str): The name of the group. - signers ([SubSignatureRequestSigner]): Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the group is required to sign in. Use this instead of Signer-level `order`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.group = group - self.signers = signers - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_signature_request_signer.py b/dropbox_sign/model/sub_signature_request_signer.py deleted file mode 100644 index 71ffb82..0000000 --- a/dropbox_sign/model/sub_signature_request_signer.py +++ /dev/null @@ -1,359 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubSignatureRequestSigner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('sms_phone_number_type',): { - 'AUTHENTICATION': "authentication", - 'DELIVERY': "delivery", - }, - } - - validations = { - ('pin',): { - 'max_length': 12, - 'min_length': 4, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'order': (int, none_type,), # noqa: E501 - 'pin': (str,), # noqa: E501 - 'sms_phone_number': (str,), # noqa: E501 - 'sms_phone_number_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubSignatureRequestSigner: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubSignatureRequestSigner], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'order': 'order', # noqa: E501 - 'pin': 'pin', # noqa: E501 - 'sms_phone_number': 'sms_phone_number', # noqa: E501 - 'sms_phone_number_type': 'sms_phone_number_type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def order(self) -> Optional[int]: - return self.get("order") - - @order.setter - def order(self, value: Optional[int]): - setattr(self, "order", value) - - @property - def pin(self) -> str: - return self.get("pin") - - @pin.setter - def pin(self, value: str): - setattr(self, "pin", value) - - @property - def sms_phone_number(self) -> str: - return self.get("sms_phone_number") - - @sms_phone_number.setter - def sms_phone_number(self, value: str): - setattr(self, "sms_phone_number", value) - - @property - def sms_phone_number_type(self) -> str: - return self.get("sms_phone_number_type") - - @sms_phone_number_type.setter - def sms_phone_number_type(self, value: str): - setattr(self, "sms_phone_number_type", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, email_address, *args, **kwargs): # noqa: E501 - """SubSignatureRequestSigner - a model defined in OpenAPI - - Args: - name (str): The name of the signer. - email_address (str): The email address of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the signer is required to sign in.. [optional] # noqa: E501 - pin (str): The 4- to 12-character access code that will secure this signer's signature page.. [optional] # noqa: E501 - sms_phone_number (str): An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.. [optional] # noqa: E501 - sms_phone_number_type (str): Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, email_address, *args, **kwargs): # noqa: E501 - """SubSignatureRequestSigner - a model defined in OpenAPI - - Args: - name (str): The name of the signer. - email_address (str): The email address of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the signer is required to sign in.. [optional] # noqa: E501 - pin (str): The 4- to 12-character access code that will secure this signer's signature page.. [optional] # noqa: E501 - sms_phone_number (str): An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.. [optional] # noqa: E501 - sms_phone_number_type (str): Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_signature_request_template_signer.py b/dropbox_sign/model/sub_signature_request_template_signer.py deleted file mode 100644 index 5d9b3ac..0000000 --- a/dropbox_sign/model/sub_signature_request_template_signer.py +++ /dev/null @@ -1,361 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubSignatureRequestTemplateSigner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('sms_phone_number_type',): { - 'AUTHENTICATION': "authentication", - 'DELIVERY': "delivery", - }, - } - - validations = { - ('pin',): { - 'max_length': 12, - 'min_length': 4, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'role': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'pin': (str,), # noqa: E501 - 'sms_phone_number': (str,), # noqa: E501 - 'sms_phone_number_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubSignatureRequestTemplateSigner: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubSignatureRequestTemplateSigner], - _check_type=True, - ) - - attribute_map = { - 'role': 'role', # noqa: E501 - 'name': 'name', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'pin': 'pin', # noqa: E501 - 'sms_phone_number': 'sms_phone_number', # noqa: E501 - 'sms_phone_number_type': 'sms_phone_number_type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def pin(self) -> str: - return self.get("pin") - - @pin.setter - def pin(self, value: str): - setattr(self, "pin", value) - - @property - def sms_phone_number(self) -> str: - return self.get("sms_phone_number") - - @sms_phone_number.setter - def sms_phone_number(self, value: str): - setattr(self, "sms_phone_number", value) - - @property - def sms_phone_number_type(self) -> str: - return self.get("sms_phone_number_type") - - @sms_phone_number_type.setter - def sms_phone_number_type(self, value: str): - setattr(self, "sms_phone_number_type", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, role, name, email_address, *args, **kwargs): # noqa: E501 - """SubSignatureRequestTemplateSigner - a model defined in OpenAPI - - Args: - role (str): Must match an existing role in chosen Template(s). It's case-sensitive. - name (str): The name of the signer. - email_address (str): The email address of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pin (str): The 4- to 12-character access code that will secure this signer's signature page.. [optional] # noqa: E501 - sms_phone_number (str): An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.. [optional] # noqa: E501 - sms_phone_number_type (str): Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, role, name, email_address, *args, **kwargs): # noqa: E501 - """SubSignatureRequestTemplateSigner - a model defined in OpenAPI - - Args: - role (str): Must match an existing role in chosen Template(s). It's case-sensitive. - name (str): The name of the signer. - email_address (str): The email address of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pin (str): The 4- to 12-character access code that will secure this signer's signature page.. [optional] # noqa: E501 - sms_phone_number (str): An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.. [optional] # noqa: E501 - sms_phone_number_type (str): Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_signing_options.py b/dropbox_sign/model/sub_signing_options.py deleted file mode 100644 index 9b47da9..0000000 --- a/dropbox_sign/model/sub_signing_options.py +++ /dev/null @@ -1,343 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubSigningOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('default_type',): { - 'DRAW': "draw", - 'PHONE': "phone", - 'TYPE': "type", - 'UPLOAD': "upload", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'default_type': (str,), # noqa: E501 - 'draw': (bool,), # noqa: E501 - 'phone': (bool,), # noqa: E501 - 'type': (bool,), # noqa: E501 - 'upload': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubSigningOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubSigningOptions], - _check_type=True, - ) - - attribute_map = { - 'default_type': 'default_type', # noqa: E501 - 'draw': 'draw', # noqa: E501 - 'phone': 'phone', # noqa: E501 - 'type': 'type', # noqa: E501 - 'upload': 'upload', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def default_type(self) -> str: - return self.get("default_type") - - @default_type.setter - def default_type(self, value: str): - setattr(self, "default_type", value) - - @property - def draw(self) -> bool: - return self.get("draw") - - @draw.setter - def draw(self, value: bool): - setattr(self, "draw", value) - - @property - def phone(self) -> bool: - return self.get("phone") - - @phone.setter - def phone(self, value: bool): - setattr(self, "phone", value) - - @property - def type(self) -> bool: - return self.get("type") - - @type.setter - def type(self, value: bool): - setattr(self, "type", value) - - @property - def upload(self) -> bool: - return self.get("upload") - - @upload.setter - def upload(self, value: bool): - setattr(self, "upload", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, default_type, *args, **kwargs): # noqa: E501 - """SubSigningOptions - a model defined in OpenAPI - - Args: - default_type (str): The default type shown (limited to the listed types) - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - draw (bool): Allows drawing the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - phone (bool): Allows using a smartphone to email the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - type (bool): Allows typing the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - upload (bool): Allows uploading the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.default_type = default_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, default_type, *args, **kwargs): # noqa: E501 - """SubSigningOptions - a model defined in OpenAPI - - Args: - default_type (str): The default type shown (limited to the listed types) - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - draw (bool): Allows drawing the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - phone (bool): Allows using a smartphone to email the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - type (bool): Allows typing the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - upload (bool): Allows uploading the signature. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.default_type = default_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_team_response.py b/dropbox_sign/model/sub_team_response.py deleted file mode 100644 index af12a90..0000000 --- a/dropbox_sign/model/sub_team_response.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubTeamResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'team_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubTeamResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubTeamResponse], - _check_type=True, - ) - - attribute_map = { - 'team_id': 'team_id', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team_id(self) -> str: - return self.get("team_id") - - @team_id.setter - def team_id(self, value: str): - setattr(self, "team_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubTeamResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubTeamResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_template_role.py b/dropbox_sign/model/sub_template_role.py deleted file mode 100644 index 5062cc4..0000000 --- a/dropbox_sign/model/sub_template_role.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubTemplateRole(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'order': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubTemplateRole: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubTemplateRole], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'order': 'order', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def order(self) -> Optional[int]: - return self.get("order") - - @order.setter - def order(self, value: Optional[int]): - setattr(self, "order", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubTemplateRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The role name of the signer that will be displayed when the template is used to create a signature request.. [optional] # noqa: E501 - order (int, none_type): The order in which this signer role is required to sign.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubTemplateRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The role name of the signer that will be displayed when the template is used to create a signature request.. [optional] # noqa: E501 - order (int, none_type): The order in which this signer role is required to sign.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_unclaimed_draft_signer.py b/dropbox_sign/model/sub_unclaimed_draft_signer.py deleted file mode 100644 index 02a3544..0000000 --- a/dropbox_sign/model/sub_unclaimed_draft_signer.py +++ /dev/null @@ -1,315 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubUnclaimedDraftSigner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'order': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubUnclaimedDraftSigner: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubUnclaimedDraftSigner], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - 'name': 'name', # noqa: E501 - 'order': 'order', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def order(self) -> Optional[int]: - return self.get("order") - - @order.setter - def order(self, value: Optional[int]): - setattr(self, "order", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email_address, name, *args, **kwargs): # noqa: E501 - """SubUnclaimedDraftSigner - a model defined in OpenAPI - - Args: - email_address (str): The email address of the signer. - name (str): The name of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the signer is required to sign in.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, email_address, name, *args, **kwargs): # noqa: E501 - """SubUnclaimedDraftSigner - a model defined in OpenAPI - - Args: - email_address (str): The email address of the signer. - name (str): The name of the signer. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - order (int, none_type): The order the signer is required to sign in.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email_address = email_address - self.name = name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_unclaimed_draft_template_signer.py b/dropbox_sign/model/sub_unclaimed_draft_template_signer.py deleted file mode 100644 index a373001..0000000 --- a/dropbox_sign/model/sub_unclaimed_draft_template_signer.py +++ /dev/null @@ -1,317 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubUnclaimedDraftTemplateSigner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'role': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubUnclaimedDraftTemplateSigner: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubUnclaimedDraftTemplateSigner], - _check_type=True, - ) - - attribute_map = { - 'role': 'role', # noqa: E501 - 'name': 'name', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, role, name, email_address, *args, **kwargs): # noqa: E501 - """SubUnclaimedDraftTemplateSigner - a model defined in OpenAPI - - Args: - role (str): Must match an existing role in chosen Template(s). - name (str): The name of the signer filling the role of `role`. - email_address (str): The email address of the signer filling the role of `role`. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, role, name, email_address, *args, **kwargs): # noqa: E501 - """SubUnclaimedDraftTemplateSigner - a model defined in OpenAPI - - Args: - role (str): Must match an existing role in chosen Template(s). - name (str): The name of the signer filling the role of `role`. - email_address (str): The email address of the signer filling the role of `role`. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.name = name - self.email_address = email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/sub_white_labeling_options.py b/dropbox_sign/model/sub_white_labeling_options.py deleted file mode 100644 index aff5078..0000000 --- a/dropbox_sign/model/sub_white_labeling_options.py +++ /dev/null @@ -1,455 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class SubWhiteLabelingOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('legal_version',): { - 'TERMS1': "terms1", - 'TERMS2': "terms2", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'header_background_color': (str,), # noqa: E501 - 'legal_version': (str,), # noqa: E501 - 'link_color': (str,), # noqa: E501 - 'page_background_color': (str,), # noqa: E501 - 'primary_button_color': (str,), # noqa: E501 - 'primary_button_color_hover': (str,), # noqa: E501 - 'primary_button_text_color': (str,), # noqa: E501 - 'primary_button_text_color_hover': (str,), # noqa: E501 - 'secondary_button_color': (str,), # noqa: E501 - 'secondary_button_color_hover': (str,), # noqa: E501 - 'secondary_button_text_color': (str,), # noqa: E501 - 'secondary_button_text_color_hover': (str,), # noqa: E501 - 'text_color1': (str,), # noqa: E501 - 'text_color2': (str,), # noqa: E501 - 'reset_to_default': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> SubWhiteLabelingOptions: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[SubWhiteLabelingOptions], - _check_type=True, - ) - - attribute_map = { - 'header_background_color': 'header_background_color', # noqa: E501 - 'legal_version': 'legal_version', # noqa: E501 - 'link_color': 'link_color', # noqa: E501 - 'page_background_color': 'page_background_color', # noqa: E501 - 'primary_button_color': 'primary_button_color', # noqa: E501 - 'primary_button_color_hover': 'primary_button_color_hover', # noqa: E501 - 'primary_button_text_color': 'primary_button_text_color', # noqa: E501 - 'primary_button_text_color_hover': 'primary_button_text_color_hover', # noqa: E501 - 'secondary_button_color': 'secondary_button_color', # noqa: E501 - 'secondary_button_color_hover': 'secondary_button_color_hover', # noqa: E501 - 'secondary_button_text_color': 'secondary_button_text_color', # noqa: E501 - 'secondary_button_text_color_hover': 'secondary_button_text_color_hover', # noqa: E501 - 'text_color1': 'text_color1', # noqa: E501 - 'text_color2': 'text_color2', # noqa: E501 - 'reset_to_default': 'reset_to_default', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def header_background_color(self) -> str: - return self.get("header_background_color") - - @header_background_color.setter - def header_background_color(self, value: str): - setattr(self, "header_background_color", value) - - @property - def legal_version(self) -> str: - return self.get("legal_version") - - @legal_version.setter - def legal_version(self, value: str): - setattr(self, "legal_version", value) - - @property - def link_color(self) -> str: - return self.get("link_color") - - @link_color.setter - def link_color(self, value: str): - setattr(self, "link_color", value) - - @property - def page_background_color(self) -> str: - return self.get("page_background_color") - - @page_background_color.setter - def page_background_color(self, value: str): - setattr(self, "page_background_color", value) - - @property - def primary_button_color(self) -> str: - return self.get("primary_button_color") - - @primary_button_color.setter - def primary_button_color(self, value: str): - setattr(self, "primary_button_color", value) - - @property - def primary_button_color_hover(self) -> str: - return self.get("primary_button_color_hover") - - @primary_button_color_hover.setter - def primary_button_color_hover(self, value: str): - setattr(self, "primary_button_color_hover", value) - - @property - def primary_button_text_color(self) -> str: - return self.get("primary_button_text_color") - - @primary_button_text_color.setter - def primary_button_text_color(self, value: str): - setattr(self, "primary_button_text_color", value) - - @property - def primary_button_text_color_hover(self) -> str: - return self.get("primary_button_text_color_hover") - - @primary_button_text_color_hover.setter - def primary_button_text_color_hover(self, value: str): - setattr(self, "primary_button_text_color_hover", value) - - @property - def secondary_button_color(self) -> str: - return self.get("secondary_button_color") - - @secondary_button_color.setter - def secondary_button_color(self, value: str): - setattr(self, "secondary_button_color", value) - - @property - def secondary_button_color_hover(self) -> str: - return self.get("secondary_button_color_hover") - - @secondary_button_color_hover.setter - def secondary_button_color_hover(self, value: str): - setattr(self, "secondary_button_color_hover", value) - - @property - def secondary_button_text_color(self) -> str: - return self.get("secondary_button_text_color") - - @secondary_button_text_color.setter - def secondary_button_text_color(self, value: str): - setattr(self, "secondary_button_text_color", value) - - @property - def secondary_button_text_color_hover(self) -> str: - return self.get("secondary_button_text_color_hover") - - @secondary_button_text_color_hover.setter - def secondary_button_text_color_hover(self, value: str): - setattr(self, "secondary_button_text_color_hover", value) - - @property - def text_color1(self) -> str: - return self.get("text_color1") - - @text_color1.setter - def text_color1(self, value: str): - setattr(self, "text_color1", value) - - @property - def text_color2(self) -> str: - return self.get("text_color2") - - @text_color2.setter - def text_color2(self, value: str): - setattr(self, "text_color2", value) - - @property - def reset_to_default(self) -> bool: - return self.get("reset_to_default") - - @reset_to_default.setter - def reset_to_default(self, value: bool): - setattr(self, "reset_to_default", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SubWhiteLabelingOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - header_background_color (str): [optional] if omitted the server will use the default value of "#1A1A1A" # noqa: E501 - legal_version (str): [optional] if omitted the server will use the default value of "terms1" # noqa: E501 - link_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - page_background_color (str): [optional] if omitted the server will use the default value of "#F7F8F9" # noqa: E501 - primary_button_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - primary_button_color_hover (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - primary_button_text_color (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - primary_button_text_color_hover (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_color (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_color_hover (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_text_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - secondary_button_text_color_hover (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - text_color1 (str): [optional] if omitted the server will use the default value of "#808080" # noqa: E501 - text_color2 (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - reset_to_default (bool): Resets white labeling options to defaults. Only useful when updating an API App.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """SubWhiteLabelingOptions - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - header_background_color (str): [optional] if omitted the server will use the default value of "#1A1A1A" # noqa: E501 - legal_version (str): [optional] if omitted the server will use the default value of "terms1" # noqa: E501 - link_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - page_background_color (str): [optional] if omitted the server will use the default value of "#F7F8F9" # noqa: E501 - primary_button_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - primary_button_color_hover (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - primary_button_text_color (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - primary_button_text_color_hover (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_color (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_color_hover (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - secondary_button_text_color (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - secondary_button_text_color_hover (str): [optional] if omitted the server will use the default value of "#00B3E6" # noqa: E501 - text_color1 (str): [optional] if omitted the server will use the default value of "#808080" # noqa: E501 - text_color2 (str): [optional] if omitted the server will use the default value of "#FFFFFF" # noqa: E501 - reset_to_default (bool): Resets white labeling options to defaults. Only useful when updating an API App.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_add_member_request.py b/dropbox_sign/model/team_add_member_request.py deleted file mode 100644 index 97fbf84..0000000 --- a/dropbox_sign/model/team_add_member_request.py +++ /dev/null @@ -1,313 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamAddMemberRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('role',): { - 'MEMBER': "Member", - 'DEVELOPER': "Developer", - 'TEAM_MANAGER': "Team Manager", - 'ADMIN': "Admin", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'role': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamAddMemberRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamAddMemberRequest], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'role': 'role', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamAddMemberRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): `account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team.. [optional] # noqa: E501 - email_address (str): `account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team.. [optional] # noqa: E501 - role (str): A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamAddMemberRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): `account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team.. [optional] # noqa: E501 - email_address (str): `account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team.. [optional] # noqa: E501 - role (str): A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_create_request.py b/dropbox_sign/model/team_create_request.py deleted file mode 100644 index 699ad65..0000000 --- a/dropbox_sign/model/team_create_request.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamCreateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team.. [optional] if omitted the server will use the default value of "Untitled Team" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamCreateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team.. [optional] if omitted the server will use the default value of "Untitled Team" # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_get_info_response.py b/dropbox_sign/model/team_get_info_response.py deleted file mode 100644 index c090889..0000000 --- a/dropbox_sign/model/team_get_info_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.team_info_response import TeamInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.team_info_response import TeamInfoResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['TeamInfoResponse'] = TeamInfoResponse - globals()['WarningResponse'] = WarningResponse - - -class TeamGetInfoResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'team': (TeamInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamGetInfoResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamGetInfoResponse], - _check_type=True, - ) - - attribute_map = { - 'team': 'team', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team(self) -> TeamInfoResponse: - return self.get("team") - - @team.setter - def team(self, value: TeamInfoResponse): - setattr(self, "team", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamGetInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team (TeamInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamGetInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team (TeamInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_get_response.py b/dropbox_sign/model/team_get_response.py deleted file mode 100644 index a3e160d..0000000 --- a/dropbox_sign/model/team_get_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.team_response import TeamResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.team_response import TeamResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['TeamResponse'] = TeamResponse - globals()['WarningResponse'] = WarningResponse - - -class TeamGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'team': (TeamResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamGetResponse], - _check_type=True, - ) - - attribute_map = { - 'team': 'team', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team(self) -> TeamResponse: - return self.get("team") - - @team.setter - def team(self, value: TeamResponse): - setattr(self, "team", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team (TeamResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team (TeamResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_info_response.py b/dropbox_sign/model/team_info_response.py deleted file mode 100644 index 218af99..0000000 --- a/dropbox_sign/model/team_info_response.py +++ /dev/null @@ -1,339 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.team_parent_response import TeamParentResponse - - -def lazy_import(): - from dropbox_sign.model.team_parent_response import TeamParentResponse - globals()['TeamParentResponse'] = TeamParentResponse - - -class TeamInfoResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'team_id': (str,), # noqa: E501 - 'team_parent': (TeamParentResponse,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'num_members': (int,), # noqa: E501 - 'num_sub_teams': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamInfoResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamInfoResponse], - _check_type=True, - ) - - attribute_map = { - 'team_id': 'team_id', # noqa: E501 - 'team_parent': 'team_parent', # noqa: E501 - 'name': 'name', # noqa: E501 - 'num_members': 'num_members', # noqa: E501 - 'num_sub_teams': 'num_sub_teams', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team_id(self) -> str: - return self.get("team_id") - - @team_id.setter - def team_id(self, value: str): - setattr(self, "team_id", value) - - @property - def team_parent(self) -> TeamParentResponse: - return self.get("team_parent") - - @team_parent.setter - def team_parent(self, value: TeamParentResponse): - setattr(self, "team_parent", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def num_members(self) -> int: - return self.get("num_members") - - @num_members.setter - def num_members(self, value: int): - setattr(self, "num_members", value) - - @property - def num_sub_teams(self) -> int: - return self.get("num_sub_teams") - - @num_sub_teams.setter - def num_sub_teams(self, value: int): - setattr(self, "num_sub_teams", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - team_parent (TeamParentResponse): [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - num_members (int): Number of members within a team. [optional] # noqa: E501 - num_sub_teams (int): Number of sub teams within a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamInfoResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - team_parent (TeamParentResponse): [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - num_members (int): Number of members within a team. [optional] # noqa: E501 - num_sub_teams (int): Number of sub teams within a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_invite_response.py b/dropbox_sign/model/team_invite_response.py deleted file mode 100644 index 80d67d4..0000000 --- a/dropbox_sign/model/team_invite_response.py +++ /dev/null @@ -1,343 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamInviteResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'email_address': (str,), # noqa: E501 - 'team_id': (str,), # noqa: E501 - 'role': (str,), # noqa: E501 - 'sent_at': (int,), # noqa: E501 - 'redeemed_at': (int,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamInviteResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamInviteResponse], - _check_type=True, - ) - - attribute_map = { - 'email_address': 'email_address', # noqa: E501 - 'team_id': 'team_id', # noqa: E501 - 'role': 'role', # noqa: E501 - 'sent_at': 'sent_at', # noqa: E501 - 'redeemed_at': 'redeemed_at', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def team_id(self) -> str: - return self.get("team_id") - - @team_id.setter - def team_id(self, value: str): - setattr(self, "team_id", value) - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @property - def sent_at(self) -> int: - return self.get("sent_at") - - @sent_at.setter - def sent_at(self, value: int): - setattr(self, "sent_at", value) - - @property - def redeemed_at(self) -> int: - return self.get("redeemed_at") - - @redeemed_at.setter - def redeemed_at(self, value: int): - setattr(self, "redeemed_at", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamInviteResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): Email address of the user invited to this team.. [optional] # noqa: E501 - team_id (str): Id of the team.. [optional] # noqa: E501 - role (str): Role of the user invited to this team.. [optional] # noqa: E501 - sent_at (int): Timestamp when the invitation was sent.. [optional] # noqa: E501 - redeemed_at (int): Timestamp when the invitation was redeemed.. [optional] # noqa: E501 - expires_at (int): Timestamp when the invitation is expiring.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamInviteResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email_address (str): Email address of the user invited to this team.. [optional] # noqa: E501 - team_id (str): Id of the team.. [optional] # noqa: E501 - role (str): Role of the user invited to this team.. [optional] # noqa: E501 - sent_at (int): Timestamp when the invitation was sent.. [optional] # noqa: E501 - redeemed_at (int): Timestamp when the invitation was redeemed.. [optional] # noqa: E501 - expires_at (int): Timestamp when the invitation is expiring.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_invites_response.py b/dropbox_sign/model/team_invites_response.py deleted file mode 100644 index a8cecf0..0000000 --- a/dropbox_sign/model/team_invites_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.team_invite_response import TeamInviteResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.team_invite_response import TeamInviteResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['TeamInviteResponse'] = TeamInviteResponse - globals()['WarningResponse'] = WarningResponse - - -class TeamInvitesResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'team_invites': ([TeamInviteResponse],), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamInvitesResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamInvitesResponse], - _check_type=True, - ) - - attribute_map = { - 'team_invites': 'team_invites', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team_invites(self) -> List[TeamInviteResponse]: - return self.get("team_invites") - - @team_invites.setter - def team_invites(self, value: List[TeamInviteResponse]): - setattr(self, "team_invites", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamInvitesResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_invites ([TeamInviteResponse]): Contains a list of team invites and their roles.. [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamInvitesResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_invites ([TeamInviteResponse]): Contains a list of team invites and their roles.. [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_member_response.py b/dropbox_sign/model/team_member_response.py deleted file mode 100644 index d300265..0000000 --- a/dropbox_sign/model/team_member_response.py +++ /dev/null @@ -1,307 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamMemberResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'role': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamMemberResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamMemberResponse], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'role': 'role', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def role(self) -> str: - return self.get("role") - - @role.setter - def role(self, value: str): - setattr(self, "role", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamMemberResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): Account id of the team member.. [optional] # noqa: E501 - email_address (str): Email address of the team member.. [optional] # noqa: E501 - role (str): The specific role a member has on the team.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamMemberResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): Account id of the team member.. [optional] # noqa: E501 - email_address (str): Email address of the team member.. [optional] # noqa: E501 - role (str): The specific role a member has on the team.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_members_response.py b/dropbox_sign/model/team_members_response.py deleted file mode 100644 index 0ff0600..0000000 --- a/dropbox_sign/model/team_members_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.team_member_response import TeamMemberResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.team_member_response import TeamMemberResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['TeamMemberResponse'] = TeamMemberResponse - globals()['WarningResponse'] = WarningResponse - - -class TeamMembersResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'team_members': ([TeamMemberResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamMembersResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamMembersResponse], - _check_type=True, - ) - - attribute_map = { - 'team_members': 'team_members', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team_members(self) -> List[TeamMemberResponse]: - return self.get("team_members") - - @team_members.setter - def team_members(self, value: List[TeamMemberResponse]): - setattr(self, "team_members", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamMembersResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_members ([TeamMemberResponse]): Contains a list of team members and their roles for a specific team.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamMembersResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_members ([TeamMemberResponse]): Contains a list of team members and their roles for a specific team.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_parent_response.py b/dropbox_sign/model/team_parent_response.py deleted file mode 100644 index bacfe3a..0000000 --- a/dropbox_sign/model/team_parent_response.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamParentResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'team_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamParentResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamParentResponse], - _check_type=True, - ) - - attribute_map = { - 'team_id': 'team_id', # noqa: E501 - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def team_id(self) -> str: - return self.get("team_id") - - @team_id.setter - def team_id(self, value: str): - setattr(self, "team_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamParentResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamParentResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - team_id (str): The id of a team. [optional] # noqa: E501 - name (str): The name of a team. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_remove_member_request.py b/dropbox_sign/model/team_remove_member_request.py deleted file mode 100644 index 6f7f9e2..0000000 --- a/dropbox_sign/model/team_remove_member_request.py +++ /dev/null @@ -1,337 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamRemoveMemberRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('new_role',): { - 'MEMBER': "Member", - 'DEVELOPER': "Developer", - 'TEAM_MANAGER': "Team Manager", - 'ADMIN': "Admin", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'new_owner_email_address': (str,), # noqa: E501 - 'new_team_id': (str,), # noqa: E501 - 'new_role': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamRemoveMemberRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamRemoveMemberRequest], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'new_owner_email_address': 'new_owner_email_address', # noqa: E501 - 'new_team_id': 'new_team_id', # noqa: E501 - 'new_role': 'new_role', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def new_owner_email_address(self) -> str: - return self.get("new_owner_email_address") - - @new_owner_email_address.setter - def new_owner_email_address(self, value: str): - setattr(self, "new_owner_email_address", value) - - @property - def new_team_id(self) -> str: - return self.get("new_team_id") - - @new_team_id.setter - def new_team_id(self, value: str): - setattr(self, "new_team_id", value) - - @property - def new_role(self) -> str: - return self.get("new_role") - - @new_role.setter - def new_role(self, value: str): - setattr(self, "new_role", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamRemoveMemberRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): **account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team.. [optional] # noqa: E501 - email_address (str): **account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team.. [optional] # noqa: E501 - new_owner_email_address (str): The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans.. [optional] # noqa: E501 - new_team_id (str): Id of the new Team.. [optional] # noqa: E501 - new_role (str): A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamRemoveMemberRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): **account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team.. [optional] # noqa: E501 - email_address (str): **account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team.. [optional] # noqa: E501 - new_owner_email_address (str): The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans.. [optional] # noqa: E501 - new_team_id (str): Id of the new Team.. [optional] # noqa: E501 - new_role (str): A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_response.py b/dropbox_sign/model/team_response.py deleted file mode 100644 index 88e2dd5..0000000 --- a/dropbox_sign/model/team_response.py +++ /dev/null @@ -1,327 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.account_response import AccountResponse - - -def lazy_import(): - from dropbox_sign.model.account_response import AccountResponse - globals()['AccountResponse'] = AccountResponse - - -class TeamResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'accounts': ([AccountResponse],), # noqa: E501 - 'invited_accounts': ([AccountResponse],), # noqa: E501 - 'invited_emails': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamResponse], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'accounts': 'accounts', # noqa: E501 - 'invited_accounts': 'invited_accounts', # noqa: E501 - 'invited_emails': 'invited_emails', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def accounts(self) -> List[AccountResponse]: - return self.get("accounts") - - @accounts.setter - def accounts(self, value: List[AccountResponse]): - setattr(self, "accounts", value) - - @property - def invited_accounts(self) -> List[AccountResponse]: - return self.get("invited_accounts") - - @invited_accounts.setter - def invited_accounts(self, value: List[AccountResponse]): - setattr(self, "invited_accounts", value) - - @property - def invited_emails(self) -> List[str]: - return self.get("invited_emails") - - @invited_emails.setter - def invited_emails(self, value: List[str]): - setattr(self, "invited_emails", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team. [optional] # noqa: E501 - accounts ([AccountResponse]): [optional] # noqa: E501 - invited_accounts ([AccountResponse]): A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`.. [optional] # noqa: E501 - invited_emails ([str]): A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team. [optional] # noqa: E501 - accounts ([AccountResponse]): [optional] # noqa: E501 - invited_accounts ([AccountResponse]): A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`.. [optional] # noqa: E501 - invited_emails ([str]): A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_sub_teams_response.py b/dropbox_sign/model/team_sub_teams_response.py deleted file mode 100644 index 4cad1d4..0000000 --- a/dropbox_sign/model/team_sub_teams_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.sub_team_response import SubTeamResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.sub_team_response import SubTeamResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['SubTeamResponse'] = SubTeamResponse - globals()['WarningResponse'] = WarningResponse - - -class TeamSubTeamsResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'sub_teams': ([SubTeamResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamSubTeamsResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamSubTeamsResponse], - _check_type=True, - ) - - attribute_map = { - 'sub_teams': 'sub_teams', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def sub_teams(self) -> List[SubTeamResponse]: - return self.get("sub_teams") - - @sub_teams.setter - def sub_teams(self, value: List[SubTeamResponse]): - setattr(self, "sub_teams", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamSubTeamsResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sub_teams ([SubTeamResponse]): Contains a list with sub teams.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamSubTeamsResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - sub_teams ([SubTeamResponse]): Contains a list with sub teams.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/team_update_request.py b/dropbox_sign/model/team_update_request.py deleted file mode 100644 index be6ca91..0000000 --- a/dropbox_sign/model/team_update_request.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TeamUpdateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TeamUpdateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TeamUpdateRequest], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TeamUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TeamUpdateRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of your Team.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_add_user_request.py b/dropbox_sign/model/template_add_user_request.py deleted file mode 100644 index b742574..0000000 --- a/dropbox_sign/model/template_add_user_request.py +++ /dev/null @@ -1,307 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateAddUserRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'skip_notification': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateAddUserRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateAddUserRequest], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'skip_notification': 'skip_notification', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def skip_notification(self) -> bool: - return self.get("skip_notification") - - @skip_notification.setter - def skip_notification(self, value: bool): - setattr(self, "skip_notification", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateAddUserRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided.. [optional] # noqa: E501 - email_address (str): The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided.. [optional] # noqa: E501 - skip_notification (bool): If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateAddUserRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided.. [optional] # noqa: E501 - email_address (str): The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided.. [optional] # noqa: E501 - skip_notification (bool): If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_create_embedded_draft_request.py b/dropbox_sign/model/template_create_embedded_draft_request.py deleted file mode 100644 index b78a53f..0000000 --- a/dropbox_sign/model/template_create_embedded_draft_request.py +++ /dev/null @@ -1,614 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_merge_field import SubMergeField - from dropbox_sign.model.sub_template_role import SubTemplateRole - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_merge_field import SubMergeField - from dropbox_sign.model.sub_template_role import SubTemplateRole - globals()['SubAttachment'] = SubAttachment - globals()['SubEditorOptions'] = SubEditorOptions - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubMergeField'] = SubMergeField - globals()['SubTemplateRole'] = SubTemplateRole - - -class TemplateCreateEmbeddedDraftRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 200, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'allow_ccs': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_roles': ([str],), # noqa: E501 - 'editor_options': (SubEditorOptions,), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'force_signer_roles': (bool,), # noqa: E501 - 'force_subject_message': (bool,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'merge_fields': ([SubMergeField],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'show_preview': (bool,), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'signer_roles': ([SubTemplateRole],), # noqa: E501 - 'skip_me_now': (bool,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_preexisting_fields': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateEmbeddedDraftRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateEmbeddedDraftRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'allow_ccs': 'allow_ccs', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_roles': 'cc_roles', # noqa: E501 - 'editor_options': 'editor_options', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'force_signer_roles': 'force_signer_roles', # noqa: E501 - 'force_subject_message': 'force_subject_message', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'merge_fields': 'merge_fields', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'show_preview': 'show_preview', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'signer_roles': 'signer_roles', # noqa: E501 - 'skip_me_now': 'skip_me_now', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_preexisting_fields': 'use_preexisting_fields', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def allow_ccs(self) -> bool: - return self.get("allow_ccs") - - @allow_ccs.setter - def allow_ccs(self, value: bool): - setattr(self, "allow_ccs", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_roles(self) -> List[str]: - return self.get("cc_roles") - - @cc_roles.setter - def cc_roles(self, value: List[str]): - setattr(self, "cc_roles", value) - - @property - def editor_options(self) -> SubEditorOptions: - return self.get("editor_options") - - @editor_options.setter - def editor_options(self, value: SubEditorOptions): - setattr(self, "editor_options", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def force_signer_roles(self) -> bool: - return self.get("force_signer_roles") - - @force_signer_roles.setter - def force_signer_roles(self, value: bool): - setattr(self, "force_signer_roles", value) - - @property - def force_subject_message(self) -> bool: - return self.get("force_subject_message") - - @force_subject_message.setter - def force_subject_message(self, value: bool): - setattr(self, "force_subject_message", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def merge_fields(self) -> List[SubMergeField]: - return self.get("merge_fields") - - @merge_fields.setter - def merge_fields(self, value: List[SubMergeField]): - setattr(self, "merge_fields", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def show_preview(self) -> bool: - return self.get("show_preview") - - @show_preview.setter - def show_preview(self, value: bool): - setattr(self, "show_preview", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def signer_roles(self) -> List[SubTemplateRole]: - return self.get("signer_roles") - - @signer_roles.setter - def signer_roles(self, value: List[SubTemplateRole]): - setattr(self, "signer_roles", value) - - @property - def skip_me_now(self) -> bool: - return self.get("skip_me_now") - - @skip_me_now.setter - def skip_me_now(self, value: bool): - setattr(self, "skip_me_now", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_preexisting_fields(self) -> bool: - return self.get("use_preexisting_fields") - - @use_preexisting_fields.setter - def use_preexisting_fields(self, value: bool): - setattr(self, "use_preexisting_fields", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template.. [optional] if omitted the server will use the default value of True # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - merge_fields ([SubMergeField]): Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.. [optional] # noqa: E501 - message (str): The default template email message.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signer_roles ([SubTemplateRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The template title (alias).. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_preexisting_fields (bool): Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template.. [optional] if omitted the server will use the default value of True # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - merge_fields ([SubMergeField]): Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.. [optional] # noqa: E501 - message (str): The default template email message.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signer_roles ([SubTemplateRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The template title (alias).. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_preexisting_fields (bool): Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_create_embedded_draft_response.py b/dropbox_sign/model/template_create_embedded_draft_response.py deleted file mode 100644 index bbc88b1..0000000 --- a/dropbox_sign/model/template_create_embedded_draft_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate - from dropbox_sign.model.warning_response import WarningResponse - globals()['TemplateCreateEmbeddedDraftResponseTemplate'] = TemplateCreateEmbeddedDraftResponseTemplate - globals()['WarningResponse'] = WarningResponse - - -class TemplateCreateEmbeddedDraftResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template': (TemplateCreateEmbeddedDraftResponseTemplate,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateEmbeddedDraftResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateEmbeddedDraftResponse], - _check_type=True, - ) - - attribute_map = { - 'template': 'template', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template(self) -> TemplateCreateEmbeddedDraftResponseTemplate: - return self.get("template") - - @template.setter - def template(self, value: TemplateCreateEmbeddedDraftResponseTemplate): - setattr(self, "template", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateCreateEmbeddedDraftResponseTemplate): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateCreateEmbeddedDraftResponseTemplate): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_create_embedded_draft_response_template.py b/dropbox_sign/model/template_create_embedded_draft_response_template.py deleted file mode 100644 index cf02872..0000000 --- a/dropbox_sign/model/template_create_embedded_draft_response_template.py +++ /dev/null @@ -1,327 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.warning_response import WarningResponse - globals()['WarningResponse'] = WarningResponse - - -class TemplateCreateEmbeddedDraftResponseTemplate(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_id': (str,), # noqa: E501 - 'edit_url': (str,), # noqa: E501 - 'expires_at': (int,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateEmbeddedDraftResponseTemplate: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateEmbeddedDraftResponseTemplate], - _check_type=True, - ) - - attribute_map = { - 'template_id': 'template_id', # noqa: E501 - 'edit_url': 'edit_url', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_id(self) -> str: - return self.get("template_id") - - @template_id.setter - def template_id(self, value: str): - setattr(self, "template_id", value) - - @property - def edit_url(self) -> str: - return self.get("edit_url") - - @edit_url.setter - def edit_url(self, value: str): - setattr(self, "edit_url", value) - - @property - def expires_at(self) -> int: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: int): - setattr(self, "expires_at", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - edit_url (str): Link to edit the template.. [optional] # noqa: E501 - expires_at (int): When the link expires.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateCreateEmbeddedDraftResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - edit_url (str): Link to edit the template.. [optional] # noqa: E501 - expires_at (int): When the link expires.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_create_request.py b/dropbox_sign/model/template_create_request.py deleted file mode 100644 index 8c9c8e6..0000000 --- a/dropbox_sign/model/template_create_request.py +++ /dev/null @@ -1,529 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_merge_field import SubMergeField - from dropbox_sign.model.sub_template_role import SubTemplateRole - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_merge_field import SubMergeField - from dropbox_sign.model.sub_template_role import SubTemplateRole - globals()['SubAttachment'] = SubAttachment - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubMergeField'] = SubMergeField - globals()['SubTemplateRole'] = SubTemplateRole - - -class TemplateCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 200, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'signer_roles': ([SubTemplateRole],), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_roles': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'merge_fields': ([SubMergeField],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'use_preexisting_fields': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'signer_roles': 'signer_roles', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_roles': 'cc_roles', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'merge_fields': 'merge_fields', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'use_preexisting_fields': 'use_preexisting_fields', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def signer_roles(self) -> List[SubTemplateRole]: - return self.get("signer_roles") - - @signer_roles.setter - def signer_roles(self, value: List[SubTemplateRole]): - setattr(self, "signer_roles", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_roles(self) -> List[str]: - return self.get("cc_roles") - - @cc_roles.setter - def cc_roles(self, value: List[str]): - setattr(self, "cc_roles", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def merge_fields(self) -> List[SubMergeField]: - return self.get("merge_fields") - - @merge_fields.setter - def merge_fields(self, value: List[SubMergeField]): - setattr(self, "merge_fields", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def use_preexisting_fields(self) -> bool: - return self.get("use_preexisting_fields") - - @use_preexisting_fields.setter - def use_preexisting_fields(self, value: bool): - setattr(self, "use_preexisting_fields", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, form_fields_per_document, signer_roles, *args, **kwargs): # noqa: E501 - """TemplateCreateRequest - a model defined in OpenAPI - - Args: - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` - signer_roles ([SubTemplateRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. [optional] # noqa: E501 - client_id (str): Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - merge_fields ([SubMergeField]): Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.. [optional] # noqa: E501 - message (str): The default template email message.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - subject (str): The template title (alias).. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_preexisting_fields (bool): Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.form_fields_per_document = form_fields_per_document - self.signer_roles = signer_roles - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, form_fields_per_document, signer_roles, *args, **kwargs): # noqa: E501 - """TemplateCreateRequest - a model defined in OpenAPI - - Args: - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` - signer_roles ([SubTemplateRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_roles ([str]): The CC roles that must be assigned when using the template to send a signature request. [optional] # noqa: E501 - client_id (str): Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - merge_fields ([SubMergeField]): Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.. [optional] # noqa: E501 - message (str): The default template email message.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - subject (str): The template title (alias).. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - use_preexisting_fields (bool): Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.form_fields_per_document = form_fields_per_document - self.signer_roles = signer_roles - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_create_response.py b/dropbox_sign/model/template_create_response.py deleted file mode 100644 index 46e4df0..0000000 --- a/dropbox_sign/model/template_create_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_create_response_template import TemplateCreateResponseTemplate - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.template_create_response_template import TemplateCreateResponseTemplate - from dropbox_sign.model.warning_response import WarningResponse - globals()['TemplateCreateResponseTemplate'] = TemplateCreateResponseTemplate - globals()['WarningResponse'] = WarningResponse - - -class TemplateCreateResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template': (TemplateCreateResponseTemplate,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateResponse], - _check_type=True, - ) - - attribute_map = { - 'template': 'template', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template(self) -> TemplateCreateResponseTemplate: - return self.get("template") - - @template.setter - def template(self, value: TemplateCreateResponseTemplate): - setattr(self, "template", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateCreateResponseTemplate): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateCreateResponseTemplate): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_create_response_template.py b/dropbox_sign/model/template_create_response_template.py deleted file mode 100644 index d80f694..0000000 --- a/dropbox_sign/model/template_create_response_template.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateCreateResponseTemplate(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'template_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateCreateResponseTemplate: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateCreateResponseTemplate], - _check_type=True, - ) - - attribute_map = { - 'template_id': 'template_id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_id(self) -> str: - return self.get("template_id") - - @template_id.setter - def template_id(self, value: str): - setattr(self, "template_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateCreateResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateCreateResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_edit_response.py b/dropbox_sign/model/template_edit_response.py deleted file mode 100644 index 793e9af..0000000 --- a/dropbox_sign/model/template_edit_response.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateEditResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'template_id': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateEditResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateEditResponse], - _check_type=True, - ) - - attribute_map = { - 'template_id': 'template_id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_id(self) -> str: - return self.get("template_id") - - @template_id.setter - def template_id(self, value: str): - setattr(self, "template_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateEditResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateEditResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_get_response.py b/dropbox_sign/model/template_get_response.py deleted file mode 100644 index 7e56c82..0000000 --- a/dropbox_sign/model/template_get_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response import TemplateResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.template_response import TemplateResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['TemplateResponse'] = TemplateResponse - globals()['WarningResponse'] = WarningResponse - - -class TemplateGetResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template': (TemplateResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateGetResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateGetResponse], - _check_type=True, - ) - - attribute_map = { - 'template': 'template', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template(self) -> TemplateResponse: - return self.get("template") - - @template.setter - def template(self, value: TemplateResponse): - setattr(self, "template", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateGetResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_list_response.py b/dropbox_sign/model/template_list_response.py deleted file mode 100644 index 3c4e01c..0000000 --- a/dropbox_sign/model/template_list_response.py +++ /dev/null @@ -1,321 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.template_response import TemplateResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.list_info_response import ListInfoResponse - from dropbox_sign.model.template_response import TemplateResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['ListInfoResponse'] = ListInfoResponse - globals()['TemplateResponse'] = TemplateResponse - globals()['WarningResponse'] = WarningResponse - - -class TemplateListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'templates': ([TemplateResponse],), # noqa: E501 - 'list_info': (ListInfoResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateListResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateListResponse], - _check_type=True, - ) - - attribute_map = { - 'templates': 'templates', # noqa: E501 - 'list_info': 'list_info', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def templates(self) -> List[TemplateResponse]: - return self.get("templates") - - @templates.setter - def templates(self, value: List[TemplateResponse]): - setattr(self, "templates", value) - - @property - def list_info(self) -> ListInfoResponse: - return self.get("list_info") - - @list_info.setter - def list_info(self, value: ListInfoResponse): - setattr(self, "list_info", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - templates ([TemplateResponse]): List of templates that the API caller has access to.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateListResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - templates ([TemplateResponse]): List of templates that the API caller has access to.. [optional] # noqa: E501 - list_info (ListInfoResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_remove_user_request.py b/dropbox_sign/model/template_remove_user_request.py deleted file mode 100644 index b3e1927..0000000 --- a/dropbox_sign/model/template_remove_user_request.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateRemoveUserRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateRemoveUserRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateRemoveUserRequest], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateRemoveUserRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.. [optional] # noqa: E501 - email_address (str): The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateRemoveUserRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.. [optional] # noqa: E501 - email_address (str): The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response.py b/dropbox_sign/model/template_response.py deleted file mode 100644 index 8a661f4..0000000 --- a/dropbox_sign/model/template_response.py +++ /dev/null @@ -1,474 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_account import TemplateResponseAccount - from dropbox_sign.model.template_response_cc_role import TemplateResponseCCRole - from dropbox_sign.model.template_response_document import TemplateResponseDocument - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_signer_role import TemplateResponseSignerRole - - -def lazy_import(): - from dropbox_sign.model.template_response_account import TemplateResponseAccount - from dropbox_sign.model.template_response_cc_role import TemplateResponseCCRole - from dropbox_sign.model.template_response_document import TemplateResponseDocument - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_signer_role import TemplateResponseSignerRole - globals()['TemplateResponseAccount'] = TemplateResponseAccount - globals()['TemplateResponseCCRole'] = TemplateResponseCCRole - globals()['TemplateResponseDocument'] = TemplateResponseDocument - globals()['TemplateResponseDocumentCustomFieldBase'] = TemplateResponseDocumentCustomFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseSignerRole'] = TemplateResponseSignerRole - - -class TemplateResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_id': (str,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'updated_at': (int,), # noqa: E501 - 'is_embedded': (bool, none_type,), # noqa: E501 - 'is_creator': (bool, none_type,), # noqa: E501 - 'can_edit': (bool, none_type,), # noqa: E501 - 'is_locked': (bool, none_type,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'signer_roles': ([TemplateResponseSignerRole],), # noqa: E501 - 'cc_roles': ([TemplateResponseCCRole],), # noqa: E501 - 'documents': ([TemplateResponseDocument],), # noqa: E501 - 'custom_fields': ([TemplateResponseDocumentCustomFieldBase], none_type,), # noqa: E501 - 'named_form_fields': ([TemplateResponseDocumentFormFieldBase], none_type,), # noqa: E501 - 'accounts': ([TemplateResponseAccount], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponse], - _check_type=True, - ) - - attribute_map = { - 'template_id': 'template_id', # noqa: E501 - 'title': 'title', # noqa: E501 - 'message': 'message', # noqa: E501 - 'updated_at': 'updated_at', # noqa: E501 - 'is_embedded': 'is_embedded', # noqa: E501 - 'is_creator': 'is_creator', # noqa: E501 - 'can_edit': 'can_edit', # noqa: E501 - 'is_locked': 'is_locked', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'signer_roles': 'signer_roles', # noqa: E501 - 'cc_roles': 'cc_roles', # noqa: E501 - 'documents': 'documents', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'named_form_fields': 'named_form_fields', # noqa: E501 - 'accounts': 'accounts', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_id(self) -> str: - return self.get("template_id") - - @template_id.setter - def template_id(self, value: str): - setattr(self, "template_id", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def updated_at(self) -> int: - return self.get("updated_at") - - @updated_at.setter - def updated_at(self, value: int): - setattr(self, "updated_at", value) - - @property - def is_embedded(self) -> Optional[bool]: - return self.get("is_embedded") - - @is_embedded.setter - def is_embedded(self, value: Optional[bool]): - setattr(self, "is_embedded", value) - - @property - def is_creator(self) -> Optional[bool]: - return self.get("is_creator") - - @is_creator.setter - def is_creator(self, value: Optional[bool]): - setattr(self, "is_creator", value) - - @property - def can_edit(self) -> Optional[bool]: - return self.get("can_edit") - - @can_edit.setter - def can_edit(self, value: Optional[bool]): - setattr(self, "can_edit", value) - - @property - def is_locked(self) -> Optional[bool]: - return self.get("is_locked") - - @is_locked.setter - def is_locked(self, value: Optional[bool]): - setattr(self, "is_locked", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def signer_roles(self) -> List[TemplateResponseSignerRole]: - return self.get("signer_roles") - - @signer_roles.setter - def signer_roles(self, value: List[TemplateResponseSignerRole]): - setattr(self, "signer_roles", value) - - @property - def cc_roles(self) -> List[TemplateResponseCCRole]: - return self.get("cc_roles") - - @cc_roles.setter - def cc_roles(self, value: List[TemplateResponseCCRole]): - setattr(self, "cc_roles", value) - - @property - def documents(self) -> List[TemplateResponseDocument]: - return self.get("documents") - - @documents.setter - def documents(self, value: List[TemplateResponseDocument]): - setattr(self, "documents", value) - - @property - def custom_fields(self) -> Optional[List[TemplateResponseDocumentCustomFieldBase]]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: Optional[List[TemplateResponseDocumentCustomFieldBase]]): - setattr(self, "custom_fields", value) - - @property - def named_form_fields(self) -> Optional[List[TemplateResponseDocumentFormFieldBase]]: - return self.get("named_form_fields") - - @named_form_fields.setter - def named_form_fields(self, value: Optional[List[TemplateResponseDocumentFormFieldBase]]): - setattr(self, "named_form_fields", value) - - @property - def accounts(self) -> Optional[List[TemplateResponseAccount]]: - return self.get("accounts") - - @accounts.setter - def accounts(self, value: Optional[List[TemplateResponseAccount]]): - setattr(self, "accounts", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - title (str): The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.. [optional] # noqa: E501 - message (str): The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.. [optional] # noqa: E501 - updated_at (int): Time the template was last updated.. [optional] # noqa: E501 - is_embedded (bool, none_type): `true` if this template was created using an embedded flow, `false` if it was created on our website.. [optional] # noqa: E501 - is_creator (bool, none_type): `true` if you are the owner of this template, `false` if it's been shared with you by a team member.. [optional] # noqa: E501 - can_edit (bool, none_type): Indicates whether edit rights have been granted to you by the owner (always `true` if that's you).. [optional] # noqa: E501 - is_locked (bool, none_type): Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the template.. [optional] # noqa: E501 - signer_roles ([TemplateResponseSignerRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - cc_roles ([TemplateResponseCCRole]): An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - documents ([TemplateResponseDocument]): An array describing each document associated with this Template. Includes form field data for each document.. [optional] # noqa: E501 - custom_fields ([TemplateResponseDocumentCustomFieldBase], none_type): Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - named_form_fields ([TemplateResponseDocumentFormFieldBase], none_type): Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - accounts ([TemplateResponseAccount], none_type): An array of the Accounts that can use this Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - title (str): The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.. [optional] # noqa: E501 - message (str): The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.. [optional] # noqa: E501 - updated_at (int): Time the template was last updated.. [optional] # noqa: E501 - is_embedded (bool, none_type): `true` if this template was created using an embedded flow, `false` if it was created on our website.. [optional] # noqa: E501 - is_creator (bool, none_type): `true` if you are the owner of this template, `false` if it's been shared with you by a team member.. [optional] # noqa: E501 - can_edit (bool, none_type): Indicates whether edit rights have been granted to you by the owner (always `true` if that's you).. [optional] # noqa: E501 - is_locked (bool, none_type): Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The metadata attached to the template.. [optional] # noqa: E501 - signer_roles ([TemplateResponseSignerRole]): An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - cc_roles ([TemplateResponseCCRole]): An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.. [optional] # noqa: E501 - documents ([TemplateResponseDocument]): An array describing each document associated with this Template. Includes form field data for each document.. [optional] # noqa: E501 - custom_fields ([TemplateResponseDocumentCustomFieldBase], none_type): Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - named_form_fields ([TemplateResponseDocumentFormFieldBase], none_type): Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - accounts ([TemplateResponseAccount], none_type): An array of the Accounts that can use this Template.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_account.py b/dropbox_sign/model/template_response_account.py deleted file mode 100644 index 311842c..0000000 --- a/dropbox_sign/model/template_response_account.py +++ /dev/null @@ -1,351 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_account_quota import TemplateResponseAccountQuota - - -def lazy_import(): - from dropbox_sign.model.template_response_account_quota import TemplateResponseAccountQuota - globals()['TemplateResponseAccountQuota'] = TemplateResponseAccountQuota - - -class TemplateResponseAccount(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'account_id': (str,), # noqa: E501 - 'email_address': (str,), # noqa: E501 - 'is_locked': (bool,), # noqa: E501 - 'is_paid_hs': (bool,), # noqa: E501 - 'is_paid_hf': (bool,), # noqa: E501 - 'quotas': (TemplateResponseAccountQuota,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseAccount: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseAccount], - _check_type=True, - ) - - attribute_map = { - 'account_id': 'account_id', # noqa: E501 - 'email_address': 'email_address', # noqa: E501 - 'is_locked': 'is_locked', # noqa: E501 - 'is_paid_hs': 'is_paid_hs', # noqa: E501 - 'is_paid_hf': 'is_paid_hf', # noqa: E501 - 'quotas': 'quotas', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def account_id(self) -> str: - return self.get("account_id") - - @account_id.setter - def account_id(self, value: str): - setattr(self, "account_id", value) - - @property - def email_address(self) -> str: - return self.get("email_address") - - @email_address.setter - def email_address(self, value: str): - setattr(self, "email_address", value) - - @property - def is_locked(self) -> bool: - return self.get("is_locked") - - @is_locked.setter - def is_locked(self, value: bool): - setattr(self, "is_locked", value) - - @property - def is_paid_hs(self) -> bool: - return self.get("is_paid_hs") - - @is_paid_hs.setter - def is_paid_hs(self, value: bool): - setattr(self, "is_paid_hs", value) - - @property - def is_paid_hf(self) -> bool: - return self.get("is_paid_hf") - - @is_paid_hf.setter - def is_paid_hf(self, value: bool): - setattr(self, "is_paid_hf", value) - - @property - def quotas(self) -> TemplateResponseAccountQuota: - return self.get("quotas") - - @quotas.setter - def quotas(self, value: TemplateResponseAccountQuota): - setattr(self, "quotas", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id of the Account.. [optional] # noqa: E501 - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - is_locked (bool): Returns `true` if the user has been locked out of their account by a team admin.. [optional] # noqa: E501 - is_paid_hs (bool): Returns `true` if the user has a paid Dropbox Sign account.. [optional] # noqa: E501 - is_paid_hf (bool): Returns `true` if the user has a paid HelloFax account.. [optional] # noqa: E501 - quotas (TemplateResponseAccountQuota): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseAccount - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - account_id (str): The id of the Account.. [optional] # noqa: E501 - email_address (str): The email address associated with the Account.. [optional] # noqa: E501 - is_locked (bool): Returns `true` if the user has been locked out of their account by a team admin.. [optional] # noqa: E501 - is_paid_hs (bool): Returns `true` if the user has a paid Dropbox Sign account.. [optional] # noqa: E501 - is_paid_hf (bool): Returns `true` if the user has a paid HelloFax account.. [optional] # noqa: E501 - quotas (TemplateResponseAccountQuota): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_account_quota.py b/dropbox_sign/model/template_response_account_quota.py deleted file mode 100644 index 4df5055..0000000 --- a/dropbox_sign/model/template_response_account_quota.py +++ /dev/null @@ -1,319 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseAccountQuota(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'templates_left': (int,), # noqa: E501 - 'api_signature_requests_left': (int,), # noqa: E501 - 'documents_left': (int,), # noqa: E501 - 'sms_verifications_left': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseAccountQuota: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseAccountQuota], - _check_type=True, - ) - - attribute_map = { - 'templates_left': 'templates_left', # noqa: E501 - 'api_signature_requests_left': 'api_signature_requests_left', # noqa: E501 - 'documents_left': 'documents_left', # noqa: E501 - 'sms_verifications_left': 'sms_verifications_left', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def templates_left(self) -> int: - return self.get("templates_left") - - @templates_left.setter - def templates_left(self, value: int): - setattr(self, "templates_left", value) - - @property - def api_signature_requests_left(self) -> int: - return self.get("api_signature_requests_left") - - @api_signature_requests_left.setter - def api_signature_requests_left(self, value: int): - setattr(self, "api_signature_requests_left", value) - - @property - def documents_left(self) -> int: - return self.get("documents_left") - - @documents_left.setter - def documents_left(self, value: int): - setattr(self, "documents_left", value) - - @property - def sms_verifications_left(self) -> int: - return self.get("sms_verifications_left") - - @sms_verifications_left.setter - def sms_verifications_left(self, value: int): - setattr(self, "sms_verifications_left", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseAccountQuota - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - templates_left (int): API templates remaining.. [optional] # noqa: E501 - api_signature_requests_left (int): API signature requests remaining.. [optional] # noqa: E501 - documents_left (int): Signature requests remaining.. [optional] # noqa: E501 - sms_verifications_left (int): SMS verifications remaining.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseAccountQuota - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - templates_left (int): API templates remaining.. [optional] # noqa: E501 - api_signature_requests_left (int): API signature requests remaining.. [optional] # noqa: E501 - documents_left (int): Signature requests remaining.. [optional] # noqa: E501 - sms_verifications_left (int): SMS verifications remaining.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_cc_role.py b/dropbox_sign/model/template_response_cc_role.py deleted file mode 100644 index cdec272..0000000 --- a/dropbox_sign/model/template_response_cc_role.py +++ /dev/null @@ -1,283 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseCCRole(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseCCRole: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseCCRole], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseCCRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Role.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseCCRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Role.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_custom_field.py b/dropbox_sign/model/template_response_custom_field.py deleted file mode 100644 index 5402cb4..0000000 --- a/dropbox_sign/model/template_response_custom_field.py +++ /dev/null @@ -1,301 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import TemplateResponseDocumentCustomFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentCustomFieldText - - -def lazy_import(): - from dropbox_sign.models import TemplateResponseDocumentCustomFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentCustomFieldText - globals()['TemplateResponseDocumentCustomFieldCheckbox'] = TemplateResponseDocumentCustomFieldCheckbox - globals()['TemplateResponseDocumentCustomFieldText'] = TemplateResponseDocumentCustomFieldText - - -class TemplateResponseCustomField(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'value': (TemplateResponseDocumentCustomFieldBase,), - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': TemplateResponseDocumentCustomFieldCheckbox, - 'text': TemplateResponseDocumentCustomFieldText, - } - if not val: - return None - return {'type': val} - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """TemplateResponseCustomField - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (TemplateResponseDocumentCustomFieldBase): # noqa: E501 - - Keyword Args: - value (TemplateResponseDocumentCustomFieldBase): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """TemplateResponseCustomField - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (TemplateResponseDocumentCustomFieldBase): # noqa: E501 - - Keyword Args: - value (TemplateResponseDocumentCustomFieldBase): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/dropbox_sign/model/template_response_document.py b/dropbox_sign/model/template_response_document.py deleted file mode 100644 index f4043f3..0000000 --- a/dropbox_sign/model/template_response_document.py +++ /dev/null @@ -1,360 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_document_field_group import TemplateResponseDocumentFieldGroup - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_document_field_group import TemplateResponseDocumentFieldGroup - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentCustomFieldBase'] = TemplateResponseDocumentCustomFieldBase - globals()['TemplateResponseDocumentFieldGroup'] = TemplateResponseDocumentFieldGroup - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocument(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'index': (int,), # noqa: E501 - 'field_groups': ([TemplateResponseDocumentFieldGroup],), # noqa: E501 - 'form_fields': ([TemplateResponseDocumentFormFieldBase],), # noqa: E501 - 'custom_fields': ([TemplateResponseDocumentCustomFieldBase],), # noqa: E501 - 'static_fields': ([TemplateResponseDocumentStaticFieldBase], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocument: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocument], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'index': 'index', # noqa: E501 - 'field_groups': 'field_groups', # noqa: E501 - 'form_fields': 'form_fields', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'static_fields': 'static_fields', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def index(self) -> int: - return self.get("index") - - @index.setter - def index(self, value: int): - setattr(self, "index", value) - - @property - def field_groups(self) -> List[TemplateResponseDocumentFieldGroup]: - return self.get("field_groups") - - @field_groups.setter - def field_groups(self, value: List[TemplateResponseDocumentFieldGroup]): - setattr(self, "field_groups", value) - - @property - def form_fields(self) -> List[TemplateResponseDocumentFormFieldBase]: - return self.get("form_fields") - - @form_fields.setter - def form_fields(self, value: List[TemplateResponseDocumentFormFieldBase]): - setattr(self, "form_fields", value) - - @property - def custom_fields(self) -> List[TemplateResponseDocumentCustomFieldBase]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[TemplateResponseDocumentCustomFieldBase]): - setattr(self, "custom_fields", value) - - @property - def static_fields(self) -> Optional[List[TemplateResponseDocumentStaticFieldBase]]: - return self.get("static_fields") - - @static_fields.setter - def static_fields(self, value: Optional[List[TemplateResponseDocumentStaticFieldBase]]): - setattr(self, "static_fields", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocument - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Name of the associated file.. [optional] # noqa: E501 - index (int): Document ordering, the lowest index is displayed first and the highest last (0-based indexing).. [optional] # noqa: E501 - field_groups ([TemplateResponseDocumentFieldGroup]): An array of Form Field Group objects.. [optional] # noqa: E501 - form_fields ([TemplateResponseDocumentFormFieldBase]): An array of Form Field objects containing the name and type of each named field.. [optional] # noqa: E501 - custom_fields ([TemplateResponseDocumentCustomFieldBase]): An array of Form Field objects containing the name and type of each named field.. [optional] # noqa: E501 - static_fields ([TemplateResponseDocumentStaticFieldBase], none_type): An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocument - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): Name of the associated file.. [optional] # noqa: E501 - index (int): Document ordering, the lowest index is displayed first and the highest last (0-based indexing).. [optional] # noqa: E501 - field_groups ([TemplateResponseDocumentFieldGroup]): An array of Form Field Group objects.. [optional] # noqa: E501 - form_fields ([TemplateResponseDocumentFormFieldBase]): An array of Form Field objects containing the name and type of each named field.. [optional] # noqa: E501 - custom_fields ([TemplateResponseDocumentCustomFieldBase]): An array of Form Field objects containing the name and type of each named field.. [optional] # noqa: E501 - static_fields ([TemplateResponseDocumentStaticFieldBase], none_type): An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_document_custom_field.py b/dropbox_sign/model/template_response_document_custom_field.py deleted file mode 100644 index 6a5721e..0000000 --- a/dropbox_sign/model/template_response_document_custom_field.py +++ /dev/null @@ -1,475 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - - -def lazy_import(): - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - globals()['TemplateResponseFieldAvgTextLength'] = TemplateResponseFieldAvgTextLength - - -class TemplateResponseDocumentCustomField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'TEXT': "text", - 'CHECKBOX': "checkbox", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - 'avg_text_length': (TemplateResponseFieldAvgTextLength,), # noqa: E501 - 'is_multiline': (bool, none_type,), # noqa: E501 - 'original_font_size': (int, none_type,), # noqa: E501 - 'font_family': (str, none_type,), # noqa: E501 - 'named_form_fields': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 - 'reusable_form_id': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentCustomField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentCustomField], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'type': 'type', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'group': 'group', # noqa: E501 - 'avg_text_length': 'avg_text_length', # noqa: E501 - 'is_multiline': 'isMultiline', # noqa: E501 - 'original_font_size': 'originalFontSize', # noqa: E501 - 'font_family': 'fontFamily', # noqa: E501 - 'named_form_fields': 'named_form_fields', # noqa: E501 - 'reusable_form_id': 'reusable_form_id', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @property - def avg_text_length(self) -> TemplateResponseFieldAvgTextLength: - return self.get("avg_text_length") - - @avg_text_length.setter - def avg_text_length(self, value: TemplateResponseFieldAvgTextLength): - setattr(self, "avg_text_length", value) - - @property - def is_multiline(self) -> Optional[bool]: - return self.get("is_multiline") - - @is_multiline.setter - def is_multiline(self, value: Optional[bool]): - setattr(self, "is_multiline", value) - - @property - def original_font_size(self) -> Optional[int]: - return self.get("original_font_size") - - @original_font_size.setter - def original_font_size(self, value: Optional[int]): - setattr(self, "original_font_size", value) - - @property - def font_family(self) -> Optional[str]: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: Optional[str]): - setattr(self, "font_family", value) - - @property - def named_form_fields(self) -> Optional[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]: - return self.get("named_form_fields") - - @named_form_fields.setter - def named_form_fields(self, value: Optional[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]): - setattr(self, "named_form_fields", value) - - @property - def reusable_form_id(self) -> Optional[str]: - return self.get("reusable_form_id") - - @reusable_form_id.setter - def reusable_form_id(self, value: Optional[str]): - setattr(self, "reusable_form_id", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Custom Field.. [optional] # noqa: E501 - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported.. [optional] # noqa: E501 - signer (str): The signer of the Custom Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool, none_type): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int, none_type): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str, none_type): Font family used in this form field's text.. [optional] # noqa: E501 - named_form_fields ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - reusable_form_id (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Custom Field.. [optional] # noqa: E501 - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported.. [optional] # noqa: E501 - signer (str): The signer of the Custom Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool, none_type): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int, none_type): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str, none_type): Font family used in this form field's text.. [optional] # noqa: E501 - named_form_fields ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.. [optional] # noqa: E501 - reusable_form_id (str, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_document_custom_field_base.py b/dropbox_sign/model/template_response_document_custom_field_base.py deleted file mode 100644 index c276730..0000000 --- a/dropbox_sign/model/template_response_document_custom_field_base.py +++ /dev/null @@ -1,400 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import TemplateResponseDocumentCustomFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentCustomFieldText - - -def lazy_import(): - from dropbox_sign.models import TemplateResponseDocumentCustomFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentCustomFieldText - globals()['TemplateResponseDocumentCustomFieldCheckbox'] = TemplateResponseDocumentCustomFieldCheckbox - globals()['TemplateResponseDocumentCustomFieldText'] = TemplateResponseDocumentCustomFieldText - - -class TemplateResponseDocumentCustomFieldBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str, none_type,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': TemplateResponseDocumentCustomFieldCheckbox, - 'text': TemplateResponseDocumentCustomFieldText, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> Optional[str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Optional[str]): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_document_custom_field_checkbox.py b/dropbox_sign/model/template_response_document_custom_field_checkbox.py deleted file mode 100644 index f69ab91..0000000 --- a/dropbox_sign/model/template_response_document_custom_field_checkbox.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - globals()['TemplateResponseDocumentCustomFieldBase'] = TemplateResponseDocumentCustomFieldBase - - -class TemplateResponseDocumentCustomFieldCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str, none_type,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentCustomFieldCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentCustomFieldCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> Optional[str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Optional[str]): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_custom_field_text.py b/dropbox_sign/model/template_response_document_custom_field_text.py deleted file mode 100644 index 6989c1d..0000000 --- a/dropbox_sign/model/template_response_document_custom_field_text.py +++ /dev/null @@ -1,500 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - - -def lazy_import(): - from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - globals()['TemplateResponseDocumentCustomFieldBase'] = TemplateResponseDocumentCustomFieldBase - globals()['TemplateResponseFieldAvgTextLength'] = TemplateResponseFieldAvgTextLength - - -class TemplateResponseDocumentCustomFieldText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'avg_text_length': (TemplateResponseFieldAvgTextLength,), # noqa: E501 - 'is_multiline': (bool,), # noqa: E501 - 'original_font_size': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str, none_type,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentCustomFieldText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentCustomFieldText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'avg_text_length': 'avg_text_length', # noqa: E501 - 'is_multiline': 'isMultiline', # noqa: E501 - 'original_font_size': 'originalFontSize', # noqa: E501 - 'font_family': 'fontFamily', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def avg_text_length(self) -> TemplateResponseFieldAvgTextLength: - return self.get("avg_text_length") - - @avg_text_length.setter - def avg_text_length(self, value: TemplateResponseFieldAvgTextLength): - setattr(self, "avg_text_length", value) - - @property - def is_multiline(self) -> bool: - return self.get("is_multiline") - - @is_multiline.setter - def is_multiline(self, value: bool): - setattr(self, "is_multiline", value) - - @property - def original_font_size(self) -> int: - return self.get("original_font_size") - - @original_font_size.setter - def original_font_size(self, value: int): - setattr(self, "original_font_size", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> Optional[str]: - return self.get("signer") - - @signer.setter - def signer(self, value: Optional[str]): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentCustomFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - api_id (str): The unique ID for this field.. [optional] # noqa: E501 - name (str): The name of the Custom Field.. [optional] # noqa: E501 - signer (str, none_type): The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_field_group.py b/dropbox_sign/model/template_response_document_field_group.py deleted file mode 100644 index 675fd87..0000000 --- a/dropbox_sign/model/template_response_document_field_group.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule - - -def lazy_import(): - from dropbox_sign.model.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule - globals()['TemplateResponseDocumentFieldGroupRule'] = TemplateResponseDocumentFieldGroupRule - - -class TemplateResponseDocumentFieldGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'name': (str,), # noqa: E501 - 'rule': (TemplateResponseDocumentFieldGroupRule,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFieldGroup: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFieldGroup], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'rule': 'rule', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def rule(self) -> TemplateResponseDocumentFieldGroupRule: - return self.get("rule") - - @rule.setter - def rule(self, value: TemplateResponseDocumentFieldGroupRule): - setattr(self, "rule", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFieldGroup - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the form field group.. [optional] # noqa: E501 - rule (TemplateResponseDocumentFieldGroupRule): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFieldGroup - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the form field group.. [optional] # noqa: E501 - rule (TemplateResponseDocumentFieldGroupRule): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_document_field_group_rule.py b/dropbox_sign/model/template_response_document_field_group_rule.py deleted file mode 100644 index a542c31..0000000 --- a/dropbox_sign/model/template_response_document_field_group_rule.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseDocumentFieldGroupRule(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'requirement': (str,), # noqa: E501 - 'group_label': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFieldGroupRule: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFieldGroupRule], - _check_type=True, - ) - - attribute_map = { - 'requirement': 'requirement', # noqa: E501 - 'group_label': 'groupLabel', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def requirement(self) -> str: - return self.get("requirement") - - @requirement.setter - def requirement(self, value: str): - setattr(self, "requirement", value) - - @property - def group_label(self) -> str: - return self.get("group_label") - - @group_label.setter - def group_label(self, value: str): - setattr(self, "group_label", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFieldGroupRule - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - requirement (str): Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.. [optional] # noqa: E501 - group_label (str): Name of the group. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFieldGroupRule - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - requirement (str): Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.. [optional] # noqa: E501 - group_label (str): Name of the group. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_document_form_field.py b/dropbox_sign/model/template_response_document_form_field.py deleted file mode 100644 index e1d4c0a..0000000 --- a/dropbox_sign/model/template_response_document_form_field.py +++ /dev/null @@ -1,459 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - - -def lazy_import(): - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - globals()['TemplateResponseFieldAvgTextLength'] = TemplateResponseFieldAvgTextLength - - -class TemplateResponseDocumentFormField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'CHECKBOX': "checkbox", - 'CHECKBOX-MERGE': "checkbox-merge", - 'DATE_SIGNED': "date_signed", - 'DROPDOWN': "dropdown", - 'HYPERLINK': "hyperlink", - 'INITIALS': "initials", - 'SIGNATURE': "signature", - 'RADIO': "radio", - 'TEXT': "text", - 'TEXT-MERGE': "text-merge", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - 'avg_text_length': (TemplateResponseFieldAvgTextLength,), # noqa: E501 - 'is_multiline': (bool, none_type,), # noqa: E501 - 'original_font_size': (int, none_type,), # noqa: E501 - 'font_family': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormField], - _check_type=True, - ) - - attribute_map = { - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'type': 'type', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - 'avg_text_length': 'avg_text_length', # noqa: E501 - 'is_multiline': 'isMultiline', # noqa: E501 - 'original_font_size': 'originalFontSize', # noqa: E501 - 'font_family': 'fontFamily', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @property - def avg_text_length(self) -> TemplateResponseFieldAvgTextLength: - return self.get("avg_text_length") - - @avg_text_length.setter - def avg_text_length(self, value: TemplateResponseFieldAvgTextLength): - setattr(self, "avg_text_length", value) - - @property - def is_multiline(self) -> Optional[bool]: - return self.get("is_multiline") - - @is_multiline.setter - def is_multiline(self, value: Optional[bool]): - setattr(self, "is_multiline", value) - - @property - def original_font_size(self) -> Optional[int]: - return self.get("original_font_size") - - @original_font_size.setter - def original_font_size(self, value: Optional[int]): - setattr(self, "original_font_size", value) - - @property - def font_family(self) -> Optional[str]: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: Optional[str]): - setattr(self, "font_family", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types).. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool, none_type): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int, none_type): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str, none_type): Font family used in this form field's text.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types).. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool, none_type): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int, none_type): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str, none_type): Font family used in this form field's text.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_document_form_field_base.py b/dropbox_sign/model/template_response_document_form_field_base.py deleted file mode 100644 index 41fcb32..0000000 --- a/dropbox_sign/model/template_response_document_form_field_base.py +++ /dev/null @@ -1,424 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import TemplateResponseDocumentFormFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentFormFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentFormFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentFormFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentFormFieldInitials - from dropbox_sign.models import TemplateResponseDocumentFormFieldRadio - from dropbox_sign.models import TemplateResponseDocumentFormFieldSignature - from dropbox_sign.models import TemplateResponseDocumentFormFieldText - - -def lazy_import(): - from dropbox_sign.models import TemplateResponseDocumentFormFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentFormFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentFormFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentFormFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentFormFieldInitials - from dropbox_sign.models import TemplateResponseDocumentFormFieldRadio - from dropbox_sign.models import TemplateResponseDocumentFormFieldSignature - from dropbox_sign.models import TemplateResponseDocumentFormFieldText - globals()['TemplateResponseDocumentFormFieldCheckbox'] = TemplateResponseDocumentFormFieldCheckbox - globals()['TemplateResponseDocumentFormFieldDateSigned'] = TemplateResponseDocumentFormFieldDateSigned - globals()['TemplateResponseDocumentFormFieldDropdown'] = TemplateResponseDocumentFormFieldDropdown - globals()['TemplateResponseDocumentFormFieldHyperlink'] = TemplateResponseDocumentFormFieldHyperlink - globals()['TemplateResponseDocumentFormFieldInitials'] = TemplateResponseDocumentFormFieldInitials - globals()['TemplateResponseDocumentFormFieldRadio'] = TemplateResponseDocumentFormFieldRadio - globals()['TemplateResponseDocumentFormFieldSignature'] = TemplateResponseDocumentFormFieldSignature - globals()['TemplateResponseDocumentFormFieldText'] = TemplateResponseDocumentFormFieldText - - -class TemplateResponseDocumentFormFieldBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': TemplateResponseDocumentFormFieldCheckbox, - 'date_signed': TemplateResponseDocumentFormFieldDateSigned, - 'dropdown': TemplateResponseDocumentFormFieldDropdown, - 'hyperlink': TemplateResponseDocumentFormFieldHyperlink, - 'initials': TemplateResponseDocumentFormFieldInitials, - 'radio': TemplateResponseDocumentFormFieldRadio, - 'signature': TemplateResponseDocumentFormFieldSignature, - 'text': TemplateResponseDocumentFormFieldText, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_document_form_field_checkbox.py b/dropbox_sign/model/template_response_document_form_field_checkbox.py deleted file mode 100644 index 732d93e..0000000 --- a/dropbox_sign/model/template_response_document_form_field_checkbox.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_form_field_date_signed.py b/dropbox_sign/model/template_response_document_form_field_date_signed.py deleted file mode 100644 index e6b00a1..0000000 --- a/dropbox_sign/model/template_response_document_form_field_date_signed.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldDateSigned(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldDateSigned: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldDateSigned], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "date_signed" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "date_signed" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_form_field_dropdown.py b/dropbox_sign/model/template_response_document_form_field_dropdown.py deleted file mode 100644 index 148a53f..0000000 --- a/dropbox_sign/model/template_response_document_form_field_dropdown.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldDropdown(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldDropdown: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldDropdown], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "dropdown" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "dropdown" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_form_field_hyperlink.py b/dropbox_sign/model/template_response_document_form_field_hyperlink.py deleted file mode 100644 index 2890513..0000000 --- a/dropbox_sign/model/template_response_document_form_field_hyperlink.py +++ /dev/null @@ -1,500 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseFieldAvgTextLength'] = TemplateResponseFieldAvgTextLength - - -class TemplateResponseDocumentFormFieldHyperlink(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'avg_text_length': (TemplateResponseFieldAvgTextLength,), # noqa: E501 - 'is_multiline': (bool,), # noqa: E501 - 'original_font_size': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldHyperlink: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldHyperlink], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'avg_text_length': 'avg_text_length', # noqa: E501 - 'is_multiline': 'isMultiline', # noqa: E501 - 'original_font_size': 'originalFontSize', # noqa: E501 - 'font_family': 'fontFamily', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def avg_text_length(self) -> TemplateResponseFieldAvgTextLength: - return self.get("avg_text_length") - - @avg_text_length.setter - def avg_text_length(self, value: TemplateResponseFieldAvgTextLength): - setattr(self, "avg_text_length", value) - - @property - def is_multiline(self) -> bool: - return self.get("is_multiline") - - @is_multiline.setter - def is_multiline(self, value: bool): - setattr(self, "is_multiline", value) - - @property - def original_font_size(self) -> int: - return self.get("original_font_size") - - @original_font_size.setter - def original_font_size(self, value: int): - setattr(self, "original_font_size", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "hyperlink" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "hyperlink" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_form_field_initials.py b/dropbox_sign/model/template_response_document_form_field_initials.py deleted file mode 100644 index 63e941b..0000000 --- a/dropbox_sign/model/template_response_document_form_field_initials.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldInitials(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldInitials: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldInitials], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldInitials - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "initials" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldInitials - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "initials" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_form_field_radio.py b/dropbox_sign/model/template_response_document_form_field_radio.py deleted file mode 100644 index fd08891..0000000 --- a/dropbox_sign/model/template_response_document_form_field_radio.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldRadio(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldRadio: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldRadio], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'group': 'group', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldRadio - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "radio" # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldRadio - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "radio" # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_form_field_signature.py b/dropbox_sign/model/template_response_document_form_field_signature.py deleted file mode 100644 index 8c83833..0000000 --- a/dropbox_sign/model/template_response_document_form_field_signature.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - - -class TemplateResponseDocumentFormFieldSignature(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldSignature: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldSignature], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldSignature - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "signature" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldSignature - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "signature" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_form_field_text.py b/dropbox_sign/model/template_response_document_form_field_text.py deleted file mode 100644 index 228cd74..0000000 --- a/dropbox_sign/model/template_response_document_form_field_text.py +++ /dev/null @@ -1,525 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - - -def lazy_import(): - from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase - from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength - globals()['TemplateResponseDocumentFormFieldBase'] = TemplateResponseDocumentFormFieldBase - globals()['TemplateResponseFieldAvgTextLength'] = TemplateResponseFieldAvgTextLength - - -class TemplateResponseDocumentFormFieldText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('validation_type',): { - 'None': None, - 'NUMBERS_ONLY': "numbers_only", - 'LETTERS_ONLY': "letters_only", - 'PHONE_NUMBER': "phone_number", - 'BANK_ROUTING_NUMBER': "bank_routing_number", - 'BANK_ACCOUNT_NUMBER': "bank_account_number", - 'EMAIL_ADDRESS': "email_address", - 'ZIP_CODE': "zip_code", - 'SOCIAL_SECURITY_NUMBER': "social_security_number", - 'EMPLOYER_IDENTIFICATION_NUMBER': "employer_identification_number", - 'CUSTOM_REGEX': "custom_regex", - }, - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'avg_text_length': (TemplateResponseFieldAvgTextLength,), # noqa: E501 - 'is_multiline': (bool,), # noqa: E501 - 'original_font_size': (int,), # noqa: E501 - 'font_family': (str,), # noqa: E501 - 'validation_type': (str, none_type,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentFormFieldText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentFormFieldText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'avg_text_length': 'avg_text_length', # noqa: E501 - 'is_multiline': 'isMultiline', # noqa: E501 - 'original_font_size': 'originalFontSize', # noqa: E501 - 'font_family': 'fontFamily', # noqa: E501 - 'validation_type': 'validation_type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def avg_text_length(self) -> TemplateResponseFieldAvgTextLength: - return self.get("avg_text_length") - - @avg_text_length.setter - def avg_text_length(self, value: TemplateResponseFieldAvgTextLength): - setattr(self, "avg_text_length", value) - - @property - def is_multiline(self) -> bool: - return self.get("is_multiline") - - @is_multiline.setter - def is_multiline(self, value: bool): - setattr(self, "is_multiline", value) - - @property - def original_font_size(self) -> int: - return self.get("original_font_size") - - @original_font_size.setter - def original_font_size(self, value: int): - setattr(self, "original_font_size", value) - - @property - def font_family(self) -> str: - return self.get("font_family") - - @font_family.setter - def font_family(self, value: str): - setattr(self, "font_family", value) - - @property - def validation_type(self) -> Optional[str]: - return self.get("validation_type") - - @validation_type.setter - def validation_type(self, value: Optional[str]): - setattr(self, "validation_type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - validation_type (str, none_type): Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.. [optional] # noqa: E501 - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentFormFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - avg_text_length (TemplateResponseFieldAvgTextLength): [optional] # noqa: E501 - is_multiline (bool): Whether this form field is multiline text.. [optional] # noqa: E501 - original_font_size (int): Original font size used in this form field's text.. [optional] # noqa: E501 - font_family (str): Font family used in this form field's text.. [optional] # noqa: E501 - validation_type (str, none_type): Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.. [optional] # noqa: E501 - api_id (str): A unique id for the form field.. [optional] # noqa: E501 - name (str): The name of the form field.. [optional] # noqa: E501 - signer (str): The signer of the Form Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this form field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this form field.. [optional] # noqa: E501 - width (int): The width in pixels of this form field.. [optional] # noqa: E501 - height (int): The height in pixels of this form field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_static_field.py b/dropbox_sign/model/template_response_document_static_field.py deleted file mode 100644 index 1339f04..0000000 --- a/dropbox_sign/model/template_response_document_static_field.py +++ /dev/null @@ -1,391 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseDocumentStaticField(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticField: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticField], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'type': 'type', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the static field.. [optional] # noqa: E501 - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types).. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticField - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the static field.. [optional] # noqa: E501 - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types).. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_document_static_field_base.py b/dropbox_sign/model/template_response_document_static_field_base.py deleted file mode 100644 index e6d4889..0000000 --- a/dropbox_sign/model/template_response_document_static_field_base.py +++ /dev/null @@ -1,424 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import TemplateResponseDocumentStaticFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentStaticFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentStaticFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentStaticFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentStaticFieldInitials - from dropbox_sign.models import TemplateResponseDocumentStaticFieldRadio - from dropbox_sign.models import TemplateResponseDocumentStaticFieldSignature - from dropbox_sign.models import TemplateResponseDocumentStaticFieldText - - -def lazy_import(): - from dropbox_sign.models import TemplateResponseDocumentStaticFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentStaticFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentStaticFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentStaticFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentStaticFieldInitials - from dropbox_sign.models import TemplateResponseDocumentStaticFieldRadio - from dropbox_sign.models import TemplateResponseDocumentStaticFieldSignature - from dropbox_sign.models import TemplateResponseDocumentStaticFieldText - globals()['TemplateResponseDocumentStaticFieldCheckbox'] = TemplateResponseDocumentStaticFieldCheckbox - globals()['TemplateResponseDocumentStaticFieldDateSigned'] = TemplateResponseDocumentStaticFieldDateSigned - globals()['TemplateResponseDocumentStaticFieldDropdown'] = TemplateResponseDocumentStaticFieldDropdown - globals()['TemplateResponseDocumentStaticFieldHyperlink'] = TemplateResponseDocumentStaticFieldHyperlink - globals()['TemplateResponseDocumentStaticFieldInitials'] = TemplateResponseDocumentStaticFieldInitials - globals()['TemplateResponseDocumentStaticFieldRadio'] = TemplateResponseDocumentStaticFieldRadio - globals()['TemplateResponseDocumentStaticFieldSignature'] = TemplateResponseDocumentStaticFieldSignature - globals()['TemplateResponseDocumentStaticFieldText'] = TemplateResponseDocumentStaticFieldText - - -class TemplateResponseDocumentStaticFieldBase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': TemplateResponseDocumentStaticFieldCheckbox, - 'date_signed': TemplateResponseDocumentStaticFieldDateSigned, - 'dropdown': TemplateResponseDocumentStaticFieldDropdown, - 'hyperlink': TemplateResponseDocumentStaticFieldHyperlink, - 'initials': TemplateResponseDocumentStaticFieldInitials, - 'radio': TemplateResponseDocumentStaticFieldRadio, - 'signature': TemplateResponseDocumentStaticFieldSignature, - 'text': TemplateResponseDocumentStaticFieldText, - } - if not val: - return None - return {'type': val} - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldBase - a model defined in OpenAPI - - Args: - type (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_document_static_field_checkbox.py b/dropbox_sign/model/template_response_document_static_field_checkbox.py deleted file mode 100644 index c2ef910..0000000 --- a/dropbox_sign/model/template_response_document_static_field_checkbox.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldCheckbox(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldCheckbox: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldCheckbox], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldCheckbox - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "checkbox" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "checkbox") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_static_field_date_signed.py b/dropbox_sign/model/template_response_document_static_field_date_signed.py deleted file mode 100644 index a4dcac4..0000000 --- a/dropbox_sign/model/template_response_document_static_field_date_signed.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldDateSigned(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldDateSigned: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldDateSigned], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "date_signed" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldDateSigned - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "date_signed" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "date_signed") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_static_field_dropdown.py b/dropbox_sign/model/template_response_document_static_field_dropdown.py deleted file mode 100644 index 666c01c..0000000 --- a/dropbox_sign/model/template_response_document_static_field_dropdown.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldDropdown(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldDropdown: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldDropdown], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "dropdown" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldDropdown - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "dropdown" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "dropdown") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_static_field_hyperlink.py b/dropbox_sign/model/template_response_document_static_field_hyperlink.py deleted file mode 100644 index 0b25b79..0000000 --- a/dropbox_sign/model/template_response_document_static_field_hyperlink.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldHyperlink(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldHyperlink: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldHyperlink], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "hyperlink" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldHyperlink - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "hyperlink" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "hyperlink") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_static_field_initials.py b/dropbox_sign/model/template_response_document_static_field_initials.py deleted file mode 100644 index c9a85a8..0000000 --- a/dropbox_sign/model/template_response_document_static_field_initials.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldInitials(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldInitials: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldInitials], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldInitials - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "initials" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldInitials - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "initials" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "initials") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_static_field_radio.py b/dropbox_sign/model/template_response_document_static_field_radio.py deleted file mode 100644 index ac524bf..0000000 --- a/dropbox_sign/model/template_response_document_static_field_radio.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldRadio(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldRadio: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldRadio], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldRadio - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "radio" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldRadio - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "radio" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "radio") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_static_field_signature.py b/dropbox_sign/model/template_response_document_static_field_signature.py deleted file mode 100644 index f395397..0000000 --- a/dropbox_sign/model/template_response_document_static_field_signature.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldSignature(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldSignature: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldSignature], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldSignature - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "signature" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldSignature - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "signature" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "signature") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_document_static_field_text.py b/dropbox_sign/model/template_response_document_static_field_text.py deleted file mode 100644 index 88f4e46..0000000 --- a/dropbox_sign/model/template_response_document_static_field_text.py +++ /dev/null @@ -1,449 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - - -def lazy_import(): - from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase - globals()['TemplateResponseDocumentStaticFieldBase'] = TemplateResponseDocumentStaticFieldBase - - -class TemplateResponseDocumentStaticFieldText(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'api_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'signer': (str,), # noqa: E501 - 'x': (int,), # noqa: E501 - 'y': (int,), # noqa: E501 - 'width': (int,), # noqa: E501 - 'height': (int,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'group': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseDocumentStaticFieldText: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseDocumentStaticFieldText], - _check_type=True, - ) - - - attribute_map = { - 'type': 'type', # noqa: E501 - 'api_id': 'api_id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'signer': 'signer', # noqa: E501 - 'x': 'x', # noqa: E501 - 'y': 'y', # noqa: E501 - 'width': 'width', # noqa: E501 - 'height': 'height', # noqa: E501 - 'required': 'required', # noqa: E501 - 'group': 'group', # noqa: E501 - } - - read_only_vars = { - } - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def api_id(self) -> str: - return self.get("api_id") - - @api_id.setter - def api_id(self, value: str): - setattr(self, "api_id", value) - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def signer(self) -> str: - return self.get("signer") - - @signer.setter - def signer(self, value: str): - setattr(self, "signer", value) - - @property - def x(self) -> int: - return self.get("x") - - @x.setter - def x(self, value: int): - setattr(self, "x", value) - - @property - def y(self) -> int: - return self.get("y") - - @y.setter - def y(self, value: int): - setattr(self, "y", value) - - @property - def width(self) -> int: - return self.get("width") - - @width.setter - def width(self, value: int): - setattr(self, "width", value) - - @property - def height(self) -> int: - return self.get("height") - - @height.setter - def height(self, value: int): - setattr(self, "height", value) - - @property - def required(self) -> bool: - return self.get("required") - - @required.setter - def required(self, value: bool): - setattr(self, "required", value) - - @property - def group(self) -> Optional[str]: - return self.get("group") - - @group.setter - def group(self, value: Optional[str]): - setattr(self, "group", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseDocumentStaticFieldText - a model defined in OpenAPI - - Keyword Args: - type (str): The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`. defaults to "text" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - api_id (str): A unique id for the static field.. [optional] # noqa: E501 - name (str): The name of the static field.. [optional] # noqa: E501 - signer (str): The signer of the Static Field.. [optional] if omitted the server will use the default value of "me_now" # noqa: E501 - x (int): The horizontal offset in pixels for this static field.. [optional] # noqa: E501 - y (int): The vertical offset in pixels for this static field.. [optional] # noqa: E501 - width (int): The width in pixels of this static field.. [optional] # noqa: E501 - height (int): The height in pixels of this static field.. [optional] # noqa: E501 - required (bool): Boolean showing whether or not this field is required.. [optional] # noqa: E501 - group (str, none_type): The name of the group this field is in. If this field is not a group, this defaults to `null`.. [optional] # noqa: E501 - """ - - type = kwargs.get('type', "text") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - 'anyOf': [ - ], - 'oneOf': [ - ], - } diff --git a/dropbox_sign/model/template_response_field_avg_text_length.py b/dropbox_sign/model/template_response_field_avg_text_length.py deleted file mode 100644 index f5474c7..0000000 --- a/dropbox_sign/model/template_response_field_avg_text_length.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseFieldAvgTextLength(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'num_lines': (int,), # noqa: E501 - 'num_chars_per_line': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseFieldAvgTextLength: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseFieldAvgTextLength], - _check_type=True, - ) - - attribute_map = { - 'num_lines': 'num_lines', # noqa: E501 - 'num_chars_per_line': 'num_chars_per_line', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def num_lines(self) -> int: - return self.get("num_lines") - - @num_lines.setter - def num_lines(self, value: int): - setattr(self, "num_lines", value) - - @property - def num_chars_per_line(self) -> int: - return self.get("num_chars_per_line") - - @num_chars_per_line.setter - def num_chars_per_line(self, value: int): - setattr(self, "num_chars_per_line", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseFieldAvgTextLength - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - num_lines (int): Number of lines.. [optional] # noqa: E501 - num_chars_per_line (int): Number of characters per line.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseFieldAvgTextLength - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - num_lines (int): Number of lines.. [optional] # noqa: E501 - num_chars_per_line (int): Number of characters per line.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_response_named_form_field.py b/dropbox_sign/model/template_response_named_form_field.py deleted file mode 100644 index 87e4747..0000000 --- a/dropbox_sign/model/template_response_named_form_field.py +++ /dev/null @@ -1,325 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - -if TYPE_CHECKING: - from dropbox_sign.models import TemplateResponseDocumentFormFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentFormFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentFormFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentFormFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentFormFieldInitials - from dropbox_sign.models import TemplateResponseDocumentFormFieldRadio - from dropbox_sign.models import TemplateResponseDocumentFormFieldSignature - from dropbox_sign.models import TemplateResponseDocumentFormFieldText - - -def lazy_import(): - from dropbox_sign.models import TemplateResponseDocumentFormFieldCheckbox - from dropbox_sign.models import TemplateResponseDocumentFormFieldDateSigned - from dropbox_sign.models import TemplateResponseDocumentFormFieldDropdown - from dropbox_sign.models import TemplateResponseDocumentFormFieldHyperlink - from dropbox_sign.models import TemplateResponseDocumentFormFieldInitials - from dropbox_sign.models import TemplateResponseDocumentFormFieldRadio - from dropbox_sign.models import TemplateResponseDocumentFormFieldSignature - from dropbox_sign.models import TemplateResponseDocumentFormFieldText - globals()['TemplateResponseDocumentFormFieldCheckbox'] = TemplateResponseDocumentFormFieldCheckbox - globals()['TemplateResponseDocumentFormFieldDateSigned'] = TemplateResponseDocumentFormFieldDateSigned - globals()['TemplateResponseDocumentFormFieldDropdown'] = TemplateResponseDocumentFormFieldDropdown - globals()['TemplateResponseDocumentFormFieldHyperlink'] = TemplateResponseDocumentFormFieldHyperlink - globals()['TemplateResponseDocumentFormFieldInitials'] = TemplateResponseDocumentFormFieldInitials - globals()['TemplateResponseDocumentFormFieldRadio'] = TemplateResponseDocumentFormFieldRadio - globals()['TemplateResponseDocumentFormFieldSignature'] = TemplateResponseDocumentFormFieldSignature - globals()['TemplateResponseDocumentFormFieldText'] = TemplateResponseDocumentFormFieldText - - -class TemplateResponseNamedFormField(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'value': (TemplateResponseDocumentFormFieldBase,), - } - - @cached_property - def discriminator(): - lazy_import() - val = { - 'checkbox': TemplateResponseDocumentFormFieldCheckbox, - 'date_signed': TemplateResponseDocumentFormFieldDateSigned, - 'dropdown': TemplateResponseDocumentFormFieldDropdown, - 'hyperlink': TemplateResponseDocumentFormFieldHyperlink, - 'initials': TemplateResponseDocumentFormFieldInitials, - 'radio': TemplateResponseDocumentFormFieldRadio, - 'signature': TemplateResponseDocumentFormFieldSignature, - 'text': TemplateResponseDocumentFormFieldText, - } - if not val: - return None - return {'type': val} - - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """TemplateResponseNamedFormField - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (TemplateResponseDocumentFormFieldBase): # noqa: E501 - - Keyword Args: - value (TemplateResponseDocumentFormFieldBase): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """TemplateResponseNamedFormField - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (TemplateResponseDocumentFormFieldBase): # noqa: E501 - - Keyword Args: - value (TemplateResponseDocumentFormFieldBase): # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/dropbox_sign/model/template_response_signer_role.py b/dropbox_sign/model/template_response_signer_role.py deleted file mode 100644 index d258879..0000000 --- a/dropbox_sign/model/template_response_signer_role.py +++ /dev/null @@ -1,295 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateResponseSignerRole(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str,), # noqa: E501 - 'order': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateResponseSignerRole: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateResponseSignerRole], - _check_type=True, - ) - - attribute_map = { - 'name': 'name', # noqa: E501 - 'order': 'order', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def name(self) -> str: - return self.get("name") - - @name.setter - def name(self, value: str): - setattr(self, "name", value) - - @property - def order(self) -> int: - return self.get("order") - - @order.setter - def order(self, value: int): - setattr(self, "order", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateResponseSignerRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Role.. [optional] # noqa: E501 - order (int): If signer order is assigned this is the 0-based index for this role.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateResponseSignerRole - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the Role.. [optional] # noqa: E501 - order (int): If signer order is assigned this is the 0-based index for this role.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_update_files_request.py b/dropbox_sign/model/template_update_files_request.py deleted file mode 100644 index cb7439b..0000000 --- a/dropbox_sign/model/template_update_files_request.py +++ /dev/null @@ -1,349 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class TemplateUpdateFilesRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('subject',): { - 'max_length': 100, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'client_id': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'message': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateUpdateFilesRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateUpdateFilesRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'message': 'message', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client_id (str): Client id of the app you're using to update this template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The new default template email message.. [optional] # noqa: E501 - subject (str): The new default template email subject.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client_id (str): Client id of the app you're using to update this template.. [optional] # noqa: E501 - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - message (str): The new default template email message.. [optional] # noqa: E501 - subject (str): The new default template email subject.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_update_files_response.py b/dropbox_sign/model/template_update_files_response.py deleted file mode 100644 index 7bd6354..0000000 --- a/dropbox_sign/model/template_update_files_response.py +++ /dev/null @@ -1,291 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.template_update_files_response_template import TemplateUpdateFilesResponseTemplate - - -def lazy_import(): - from dropbox_sign.model.template_update_files_response_template import TemplateUpdateFilesResponseTemplate - globals()['TemplateUpdateFilesResponseTemplate'] = TemplateUpdateFilesResponseTemplate - - -class TemplateUpdateFilesResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template': (TemplateUpdateFilesResponseTemplate,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateUpdateFilesResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateUpdateFilesResponse], - _check_type=True, - ) - - attribute_map = { - 'template': 'template', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template(self) -> TemplateUpdateFilesResponseTemplate: - return self.get("template") - - @template.setter - def template(self, value: TemplateUpdateFilesResponseTemplate): - setattr(self, "template", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateUpdateFilesResponseTemplate): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template (TemplateUpdateFilesResponseTemplate): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/template_update_files_response_template.py b/dropbox_sign/model/template_update_files_response_template.py deleted file mode 100644 index fca6830..0000000 --- a/dropbox_sign/model/template_update_files_response_template.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.warning_response import WarningResponse - globals()['WarningResponse'] = WarningResponse - - -class TemplateUpdateFilesResponseTemplate(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'template_id': (str,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> TemplateUpdateFilesResponseTemplate: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[TemplateUpdateFilesResponseTemplate], - _check_type=True, - ) - - attribute_map = { - 'template_id': 'template_id', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def template_id(self) -> str: - return self.get("template_id") - - @template_id.setter - def template_id(self, value: str): - setattr(self, "template_id", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TemplateUpdateFilesResponseTemplate - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - template_id (str): The id of the Template.. [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/unclaimed_draft_create_embedded_request.py b/dropbox_sign/model/unclaimed_draft_create_embedded_request.py deleted file mode 100644 index 5aba8db..0000000 --- a/dropbox_sign/model/unclaimed_draft_create_embedded_request.py +++ /dev/null @@ -1,755 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubEditorOptions'] = SubEditorOptions - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSigningOptions'] = SubSigningOptions - globals()['SubUnclaimedDraftSigner'] = SubUnclaimedDraftSigner - - -class UnclaimedDraftCreateEmbeddedRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'SEND_DOCUMENT': "send_document", - 'REQUEST_SIGNATURE': "request_signature", - }, - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 200, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'requester_email_address': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'allow_ccs': (bool,), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'editor_options': (SubEditorOptions,), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'force_signer_page': (bool,), # noqa: E501 - 'force_subject_message': (bool,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'hold_request': (bool,), # noqa: E501 - 'is_for_embedded_signing': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'requesting_redirect_url': (str,), # noqa: E501 - 'show_preview': (bool,), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'signers': ([SubUnclaimedDraftSigner],), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'skip_me_now': (bool,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'use_preexisting_fields': (bool,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftCreateEmbeddedRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftCreateEmbeddedRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'requester_email_address': 'requester_email_address', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'allow_ccs': 'allow_ccs', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'editor_options': 'editor_options', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'force_signer_page': 'force_signer_page', # noqa: E501 - 'force_subject_message': 'force_subject_message', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'hold_request': 'hold_request', # noqa: E501 - 'is_for_embedded_signing': 'is_for_embedded_signing', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'requesting_redirect_url': 'requesting_redirect_url', # noqa: E501 - 'show_preview': 'show_preview', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'skip_me_now': 'skip_me_now', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'type': 'type', # noqa: E501 - 'use_preexisting_fields': 'use_preexisting_fields', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def requester_email_address(self) -> str: - return self.get("requester_email_address") - - @requester_email_address.setter - def requester_email_address(self, value: str): - setattr(self, "requester_email_address", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def allow_ccs(self) -> bool: - return self.get("allow_ccs") - - @allow_ccs.setter - def allow_ccs(self, value: bool): - setattr(self, "allow_ccs", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def editor_options(self) -> SubEditorOptions: - return self.get("editor_options") - - @editor_options.setter - def editor_options(self, value: SubEditorOptions): - setattr(self, "editor_options", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def force_signer_page(self) -> bool: - return self.get("force_signer_page") - - @force_signer_page.setter - def force_signer_page(self, value: bool): - setattr(self, "force_signer_page", value) - - @property - def force_subject_message(self) -> bool: - return self.get("force_subject_message") - - @force_subject_message.setter - def force_subject_message(self, value: bool): - setattr(self, "force_subject_message", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def hold_request(self) -> bool: - return self.get("hold_request") - - @hold_request.setter - def hold_request(self, value: bool): - setattr(self, "hold_request", value) - - @property - def is_for_embedded_signing(self) -> bool: - return self.get("is_for_embedded_signing") - - @is_for_embedded_signing.setter - def is_for_embedded_signing(self, value: bool): - setattr(self, "is_for_embedded_signing", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def requesting_redirect_url(self) -> str: - return self.get("requesting_redirect_url") - - @requesting_redirect_url.setter - def requesting_redirect_url(self, value: str): - setattr(self, "requesting_redirect_url", value) - - @property - def show_preview(self) -> bool: - return self.get("show_preview") - - @show_preview.setter - def show_preview(self, value: bool): - setattr(self, "show_preview", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def signers(self) -> List[SubUnclaimedDraftSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubUnclaimedDraftSigner]): - setattr(self, "signers", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def skip_me_now(self) -> bool: - return self.get("skip_me_now") - - @skip_me_now.setter - def skip_me_now(self, value: bool): - setattr(self, "skip_me_now", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def use_preexisting_fields(self) -> bool: - return self.get("use_preexisting_fields") - - @use_preexisting_fields.setter - def use_preexisting_fields(self, value: bool): - setattr(self, "use_preexisting_fields", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, requester_email_address, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - requester_email_address (str): The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.. [optional] if omitted the server will use the default value of True # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - force_signer_page (bool): Provide users the ability to review/edit the signers.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.. [optional] if omitted the server will use the default value of False # noqa: E501 - hold_request (bool): The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftSigner]): Add Signers to your Unclaimed Draft Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - type (str): The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it.. [optional] if omitted the server will use the default value of "request_signature" # noqa: E501 - use_preexisting_fields (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_text_tags (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.requester_email_address = requester_email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, requester_email_address, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateEmbeddedRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - requester_email_address (str): The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.. [optional] if omitted the server will use the default value of True # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - force_signer_page (bool): Provide users the ability to review/edit the signers.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.. [optional] if omitted the server will use the default value of False # noqa: E501 - hold_request (bool): The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftSigner]): Add Signers to your Unclaimed Draft Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - type (str): The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it.. [optional] if omitted the server will use the default value of "request_signature" # noqa: E501 - use_preexisting_fields (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_text_tags (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.requester_email_address = requester_email_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/unclaimed_draft_create_embedded_with_template_request.py b/dropbox_sign/model/unclaimed_draft_create_embedded_with_template_request.py deleted file mode 100644 index 6c3a935..0000000 --- a/dropbox_sign/model/unclaimed_draft_create_embedded_with_template_request.py +++ /dev/null @@ -1,675 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner - - -def lazy_import(): - from dropbox_sign.model.sub_cc import SubCC - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_editor_options import SubEditorOptions - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner - globals()['SubCC'] = SubCC - globals()['SubCustomField'] = SubCustomField - globals()['SubEditorOptions'] = SubEditorOptions - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubSigningOptions'] = SubSigningOptions - globals()['SubUnclaimedDraftTemplateSigner'] = SubUnclaimedDraftTemplateSigner - - -class UnclaimedDraftCreateEmbeddedWithTemplateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 255, - }, - ('title',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'requester_email_address': (str,), # noqa: E501 - 'template_ids': ([str],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'allow_reassign': (bool,), # noqa: E501 - 'ccs': ([SubCC],), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'editor_options': (SubEditorOptions,), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'force_signer_roles': (bool,), # noqa: E501 - 'force_subject_message': (bool,), # noqa: E501 - 'hold_request': (bool,), # noqa: E501 - 'is_for_embedded_signing': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'preview_only': (bool,), # noqa: E501 - 'requesting_redirect_url': (str,), # noqa: E501 - 'show_preview': (bool,), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'signers': ([SubUnclaimedDraftTemplateSigner],), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'skip_me_now': (bool,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'populate_auto_fill_fields': (bool,), # noqa: E501 - 'allow_ccs': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftCreateEmbeddedWithTemplateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftCreateEmbeddedWithTemplateRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'requester_email_address': 'requester_email_address', # noqa: E501 - 'template_ids': 'template_ids', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'allow_reassign': 'allow_reassign', # noqa: E501 - 'ccs': 'ccs', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'editor_options': 'editor_options', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'force_signer_roles': 'force_signer_roles', # noqa: E501 - 'force_subject_message': 'force_subject_message', # noqa: E501 - 'hold_request': 'hold_request', # noqa: E501 - 'is_for_embedded_signing': 'is_for_embedded_signing', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'preview_only': 'preview_only', # noqa: E501 - 'requesting_redirect_url': 'requesting_redirect_url', # noqa: E501 - 'show_preview': 'show_preview', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'skip_me_now': 'skip_me_now', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'title': 'title', # noqa: E501 - 'populate_auto_fill_fields': 'populate_auto_fill_fields', # noqa: E501 - 'allow_ccs': 'allow_ccs', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def requester_email_address(self) -> str: - return self.get("requester_email_address") - - @requester_email_address.setter - def requester_email_address(self, value: str): - setattr(self, "requester_email_address", value) - - @property - def template_ids(self) -> List[str]: - return self.get("template_ids") - - @template_ids.setter - def template_ids(self, value: List[str]): - setattr(self, "template_ids", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def allow_reassign(self) -> bool: - return self.get("allow_reassign") - - @allow_reassign.setter - def allow_reassign(self, value: bool): - setattr(self, "allow_reassign", value) - - @property - def ccs(self) -> List[SubCC]: - return self.get("ccs") - - @ccs.setter - def ccs(self, value: List[SubCC]): - setattr(self, "ccs", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def editor_options(self) -> SubEditorOptions: - return self.get("editor_options") - - @editor_options.setter - def editor_options(self, value: SubEditorOptions): - setattr(self, "editor_options", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def force_signer_roles(self) -> bool: - return self.get("force_signer_roles") - - @force_signer_roles.setter - def force_signer_roles(self, value: bool): - setattr(self, "force_signer_roles", value) - - @property - def force_subject_message(self) -> bool: - return self.get("force_subject_message") - - @force_subject_message.setter - def force_subject_message(self, value: bool): - setattr(self, "force_subject_message", value) - - @property - def hold_request(self) -> bool: - return self.get("hold_request") - - @hold_request.setter - def hold_request(self, value: bool): - setattr(self, "hold_request", value) - - @property - def is_for_embedded_signing(self) -> bool: - return self.get("is_for_embedded_signing") - - @is_for_embedded_signing.setter - def is_for_embedded_signing(self, value: bool): - setattr(self, "is_for_embedded_signing", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def preview_only(self) -> bool: - return self.get("preview_only") - - @preview_only.setter - def preview_only(self, value: bool): - setattr(self, "preview_only", value) - - @property - def requesting_redirect_url(self) -> str: - return self.get("requesting_redirect_url") - - @requesting_redirect_url.setter - def requesting_redirect_url(self, value: str): - setattr(self, "requesting_redirect_url", value) - - @property - def show_preview(self) -> bool: - return self.get("show_preview") - - @show_preview.setter - def show_preview(self, value: bool): - setattr(self, "show_preview", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def signers(self) -> List[SubUnclaimedDraftTemplateSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubUnclaimedDraftTemplateSigner]): - setattr(self, "signers", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def skip_me_now(self) -> bool: - return self.get("skip_me_now") - - @skip_me_now.setter - def skip_me_now(self, value: bool): - setattr(self, "skip_me_now", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def title(self) -> str: - return self.get("title") - - @title.setter - def title(self, value: str): - setattr(self, "title", value) - - @property - def populate_auto_fill_fields(self) -> bool: - return self.get("populate_auto_fill_fields") - - @populate_auto_fill_fields.setter - def populate_auto_fill_fields(self, value: bool): - setattr(self, "populate_auto_fill_fields", value) - - @property - def allow_ccs(self) -> bool: - return self.get("allow_ccs") - - @allow_ccs.setter - def allow_ccs(self, value: bool): - setattr(self, "allow_ccs", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, requester_email_address, template_ids, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - requester_email_address (str): The email address of the user that should be designated as the requester of this draft. - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - files ([file_type]): Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.. [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - hold_request (bool): The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - preview_only (bool): This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set).. [optional] if omitted the server will use the default value of False # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftTemplateSigner]): Add Signers to your Templated-based Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.requester_email_address = requester_email_address - self.template_ids = template_ids - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, requester_email_address, template_ids, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateEmbeddedWithTemplateRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - requester_email_address (str): The email address of the user that should be designated as the requester of this draft. - template_ids ([str]): Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_reassign (bool): Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.. [optional] if omitted the server will use the default value of False # noqa: E501 - ccs ([SubCC]): Add CC email recipients. Required when a CC role exists for the Template.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): An array defining values and options for custom fields. Required when a custom field exists in the Template.. [optional] # noqa: E501 - editor_options (SubEditorOptions): [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - files ([file_type]): Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.. [optional] # noqa: E501 - force_signer_roles (bool): Provide users the ability to review/edit the template signer roles.. [optional] if omitted the server will use the default value of False # noqa: E501 - force_subject_message (bool): Provide users the ability to review/edit the template subject and message.. [optional] if omitted the server will use the default value of False # noqa: E501 - hold_request (bool): The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - preview_only (bool): This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set).. [optional] if omitted the server will use the default value of False # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_preview (bool): This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.. [optional] if omitted the server will use the default value of False # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftTemplateSigner]): Add Signers to your Templated-based Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - skip_me_now (bool): Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - title (str): The title you want to assign to the SignatureRequest.. [optional] # noqa: E501 - populate_auto_fill_fields (bool): Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.. [optional] if omitted the server will use the default value of False # noqa: E501 - allow_ccs (bool): This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.requester_email_address = requester_email_address - self.template_ids = template_ids - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/unclaimed_draft_create_request.py b/dropbox_sign/model/unclaimed_draft_create_request.py deleted file mode 100644 index 960d727..0000000 --- a/dropbox_sign/model/unclaimed_draft_create_request.py +++ /dev/null @@ -1,606 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner - - -def lazy_import(): - from dropbox_sign.model.sub_attachment import SubAttachment - from dropbox_sign.model.sub_custom_field import SubCustomField - from dropbox_sign.model.sub_field_options import SubFieldOptions - from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup - from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule - from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase - from dropbox_sign.model.sub_signing_options import SubSigningOptions - from dropbox_sign.model.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner - globals()['SubAttachment'] = SubAttachment - globals()['SubCustomField'] = SubCustomField - globals()['SubFieldOptions'] = SubFieldOptions - globals()['SubFormFieldGroup'] = SubFormFieldGroup - globals()['SubFormFieldRule'] = SubFormFieldRule - globals()['SubFormFieldsPerDocumentBase'] = SubFormFieldsPerDocumentBase - globals()['SubSigningOptions'] = SubSigningOptions - globals()['SubUnclaimedDraftSigner'] = SubUnclaimedDraftSigner - - -class UnclaimedDraftCreateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('type',): { - 'SEND_DOCUMENT': "send_document", - 'REQUEST_SIGNATURE': "request_signature", - }, - } - - validations = { - ('message',): { - 'max_length': 5000, - }, - ('metadata',): { - }, - ('subject',): { - 'max_length': 200, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'type': (str,), # noqa: E501 - 'files': ([file_type],), # noqa: E501 - 'file_urls': ([str],), # noqa: E501 - 'allow_decline': (bool,), # noqa: E501 - 'attachments': ([SubAttachment],), # noqa: E501 - 'cc_email_addresses': ([str],), # noqa: E501 - 'client_id': (str,), # noqa: E501 - 'custom_fields': ([SubCustomField],), # noqa: E501 - 'field_options': (SubFieldOptions,), # noqa: E501 - 'form_field_groups': ([SubFormFieldGroup],), # noqa: E501 - 'form_field_rules': ([SubFormFieldRule],), # noqa: E501 - 'form_fields_per_document': ([SubFormFieldsPerDocumentBase],), # noqa: E501 - 'hide_text_tags': (bool,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'signers': ([SubUnclaimedDraftSigner],), # noqa: E501 - 'signing_options': (SubSigningOptions,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'subject': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - 'use_preexisting_fields': (bool,), # noqa: E501 - 'use_text_tags': (bool,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftCreateRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftCreateRequest], - _check_type=True, - ) - - attribute_map = { - 'type': 'type', # noqa: E501 - 'files': 'files', # noqa: E501 - 'file_urls': 'file_urls', # noqa: E501 - 'allow_decline': 'allow_decline', # noqa: E501 - 'attachments': 'attachments', # noqa: E501 - 'cc_email_addresses': 'cc_email_addresses', # noqa: E501 - 'client_id': 'client_id', # noqa: E501 - 'custom_fields': 'custom_fields', # noqa: E501 - 'field_options': 'field_options', # noqa: E501 - 'form_field_groups': 'form_field_groups', # noqa: E501 - 'form_field_rules': 'form_field_rules', # noqa: E501 - 'form_fields_per_document': 'form_fields_per_document', # noqa: E501 - 'hide_text_tags': 'hide_text_tags', # noqa: E501 - 'message': 'message', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'signers': 'signers', # noqa: E501 - 'signing_options': 'signing_options', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'subject': 'subject', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - 'use_preexisting_fields': 'use_preexisting_fields', # noqa: E501 - 'use_text_tags': 'use_text_tags', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def type(self) -> str: - return self.get("type") - - @type.setter - def type(self, value: str): - setattr(self, "type", value) - - @property - def files(self) -> List[file_type]: - return self.get("files") - - @files.setter - def files(self, value: List[file_type]): - setattr(self, "files", value) - - @property - def file_urls(self) -> List[str]: - return self.get("file_urls") - - @file_urls.setter - def file_urls(self, value: List[str]): - setattr(self, "file_urls", value) - - @property - def allow_decline(self) -> bool: - return self.get("allow_decline") - - @allow_decline.setter - def allow_decline(self, value: bool): - setattr(self, "allow_decline", value) - - @property - def attachments(self) -> List[SubAttachment]: - return self.get("attachments") - - @attachments.setter - def attachments(self, value: List[SubAttachment]): - setattr(self, "attachments", value) - - @property - def cc_email_addresses(self) -> List[str]: - return self.get("cc_email_addresses") - - @cc_email_addresses.setter - def cc_email_addresses(self, value: List[str]): - setattr(self, "cc_email_addresses", value) - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def custom_fields(self) -> List[SubCustomField]: - return self.get("custom_fields") - - @custom_fields.setter - def custom_fields(self, value: List[SubCustomField]): - setattr(self, "custom_fields", value) - - @property - def field_options(self) -> SubFieldOptions: - return self.get("field_options") - - @field_options.setter - def field_options(self, value: SubFieldOptions): - setattr(self, "field_options", value) - - @property - def form_field_groups(self) -> List[SubFormFieldGroup]: - return self.get("form_field_groups") - - @form_field_groups.setter - def form_field_groups(self, value: List[SubFormFieldGroup]): - setattr(self, "form_field_groups", value) - - @property - def form_field_rules(self) -> List[SubFormFieldRule]: - return self.get("form_field_rules") - - @form_field_rules.setter - def form_field_rules(self, value: List[SubFormFieldRule]): - setattr(self, "form_field_rules", value) - - @property - def form_fields_per_document(self) -> List[SubFormFieldsPerDocumentBase]: - return self.get("form_fields_per_document") - - @form_fields_per_document.setter - def form_fields_per_document(self, value: List[SubFormFieldsPerDocumentBase]): - setattr(self, "form_fields_per_document", value) - - @property - def hide_text_tags(self) -> bool: - return self.get("hide_text_tags") - - @hide_text_tags.setter - def hide_text_tags(self, value: bool): - setattr(self, "hide_text_tags", value) - - @property - def message(self) -> str: - return self.get("message") - - @message.setter - def message(self, value: str): - setattr(self, "message", value) - - @property - def metadata(self) -> Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]: - return self.get("metadata") - - @metadata.setter - def metadata(self, value: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, none_type]]): - setattr(self, "metadata", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def signers(self) -> List[SubUnclaimedDraftSigner]: - return self.get("signers") - - @signers.setter - def signers(self, value: List[SubUnclaimedDraftSigner]): - setattr(self, "signers", value) - - @property - def signing_options(self) -> SubSigningOptions: - return self.get("signing_options") - - @signing_options.setter - def signing_options(self, value: SubSigningOptions): - setattr(self, "signing_options", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def subject(self) -> str: - return self.get("subject") - - @subject.setter - def subject(self, value: str): - setattr(self, "subject", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @property - def use_preexisting_fields(self) -> bool: - return self.get("use_preexisting_fields") - - @use_preexisting_fields.setter - def use_preexisting_fields(self, value: bool): - setattr(self, "use_preexisting_fields", value) - - @property - def use_text_tags(self) -> bool: - return self.get("use_text_tags") - - @use_text_tags.setter - def use_text_tags(self, value: bool): - setattr(self, "use_text_tags", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateRequest - a model defined in OpenAPI - - Args: - type (str): The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftSigner]): Add Signers to your Unclaimed Draft Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_preexisting_fields (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_text_tags (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateRequest - a model defined in OpenAPI - - Args: - type (str): The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - files ([file_type]): Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - file_urls ([str]): Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.. [optional] # noqa: E501 - allow_decline (bool): Allows signers to decline to sign a document if `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - attachments ([SubAttachment]): A list describing the attachments. [optional] # noqa: E501 - cc_email_addresses ([str]): The email addresses that should be CCed.. [optional] # noqa: E501 - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.. [optional] # noqa: E501 - custom_fields ([SubCustomField]): When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.. [optional] # noqa: E501 - field_options (SubFieldOptions): [optional] # noqa: E501 - form_field_groups ([SubFormFieldGroup]): Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.. [optional] # noqa: E501 - form_field_rules ([SubFormFieldRule]): Conditional Logic rules for fields defined in `form_fields_per_document`.. [optional] # noqa: E501 - form_fields_per_document ([SubFormFieldsPerDocumentBase]): The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`. [optional] # noqa: E501 - hide_text_tags (bool): Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.. [optional] if omitted the server will use the default value of False # noqa: E501 - message (str): The custom message in the email that will be sent to the signers.. [optional] # noqa: E501 - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signers ([SubUnclaimedDraftSigner]): Add Signers to your Unclaimed Draft Signature Request.. [optional] # noqa: E501 - signing_options (SubSigningOptions): [optional] # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - subject (str): The subject in the email that will be sent to the signers.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_preexisting_fields (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - use_text_tags (bool): Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.. [optional] if omitted the server will use the default value of False # noqa: E501 - expires_at (int, none_type): When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/unclaimed_draft_create_response.py b/dropbox_sign/model/unclaimed_draft_create_response.py deleted file mode 100644 index d2c585e..0000000 --- a/dropbox_sign/model/unclaimed_draft_create_response.py +++ /dev/null @@ -1,306 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.unclaimed_draft_response import UnclaimedDraftResponse - from dropbox_sign.model.warning_response import WarningResponse - - -def lazy_import(): - from dropbox_sign.model.unclaimed_draft_response import UnclaimedDraftResponse - from dropbox_sign.model.warning_response import WarningResponse - globals()['UnclaimedDraftResponse'] = UnclaimedDraftResponse - globals()['WarningResponse'] = WarningResponse - - -class UnclaimedDraftCreateResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'unclaimed_draft': (UnclaimedDraftResponse,), # noqa: E501 - 'warnings': ([WarningResponse],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftCreateResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftCreateResponse], - _check_type=True, - ) - - attribute_map = { - 'unclaimed_draft': 'unclaimed_draft', # noqa: E501 - 'warnings': 'warnings', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def unclaimed_draft(self) -> UnclaimedDraftResponse: - return self.get("unclaimed_draft") - - @unclaimed_draft.setter - def unclaimed_draft(self, value: UnclaimedDraftResponse): - setattr(self, "unclaimed_draft", value) - - @property - def warnings(self) -> List[WarningResponse]: - return self.get("warnings") - - @warnings.setter - def warnings(self, value: List[WarningResponse]): - setattr(self, "warnings", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - unclaimed_draft (UnclaimedDraftResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """UnclaimedDraftCreateResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - unclaimed_draft (UnclaimedDraftResponse): [optional] # noqa: E501 - warnings ([WarningResponse]): A list of warnings.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/unclaimed_draft_edit_and_resend_request.py b/dropbox_sign/model/unclaimed_draft_edit_and_resend_request.py deleted file mode 100644 index 3ddf62f..0000000 --- a/dropbox_sign/model/unclaimed_draft_edit_and_resend_request.py +++ /dev/null @@ -1,381 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError -if TYPE_CHECKING: - from dropbox_sign.model.sub_editor_options import SubEditorOptions - - -def lazy_import(): - from dropbox_sign.model.sub_editor_options import SubEditorOptions - globals()['SubEditorOptions'] = SubEditorOptions - - -class UnclaimedDraftEditAndResendRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'client_id': (str,), # noqa: E501 - 'editor_options': (SubEditorOptions,), # noqa: E501 - 'is_for_embedded_signing': (bool,), # noqa: E501 - 'requester_email_address': (str,), # noqa: E501 - 'requesting_redirect_url': (str,), # noqa: E501 - 'show_progress_stepper': (bool,), # noqa: E501 - 'signing_redirect_url': (str,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftEditAndResendRequest: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftEditAndResendRequest], - _check_type=True, - ) - - attribute_map = { - 'client_id': 'client_id', # noqa: E501 - 'editor_options': 'editor_options', # noqa: E501 - 'is_for_embedded_signing': 'is_for_embedded_signing', # noqa: E501 - 'requester_email_address': 'requester_email_address', # noqa: E501 - 'requesting_redirect_url': 'requesting_redirect_url', # noqa: E501 - 'show_progress_stepper': 'show_progress_stepper', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def client_id(self) -> str: - return self.get("client_id") - - @client_id.setter - def client_id(self, value: str): - setattr(self, "client_id", value) - - @property - def editor_options(self) -> SubEditorOptions: - return self.get("editor_options") - - @editor_options.setter - def editor_options(self, value: SubEditorOptions): - setattr(self, "editor_options", value) - - @property - def is_for_embedded_signing(self) -> bool: - return self.get("is_for_embedded_signing") - - @is_for_embedded_signing.setter - def is_for_embedded_signing(self, value: bool): - setattr(self, "is_for_embedded_signing", value) - - @property - def requester_email_address(self) -> str: - return self.get("requester_email_address") - - @requester_email_address.setter - def requester_email_address(self, value: str): - setattr(self, "requester_email_address", value) - - @property - def requesting_redirect_url(self) -> str: - return self.get("requesting_redirect_url") - - @requesting_redirect_url.setter - def requesting_redirect_url(self, value: str): - setattr(self, "requesting_redirect_url", value) - - @property - def show_progress_stepper(self) -> bool: - return self.get("show_progress_stepper") - - @show_progress_stepper.setter - def show_progress_stepper(self, value: bool): - setattr(self, "show_progress_stepper", value) - - @property - def signing_redirect_url(self) -> str: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: str): - setattr(self, "signing_redirect_url", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, *args, **kwargs): # noqa: E501 - """UnclaimedDraftEditAndResendRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - editor_options (SubEditorOptions): [optional] # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`.. [optional] # noqa: E501 - requester_email_address (str): The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used.. [optional] # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, *args, **kwargs): # noqa: E501 - """UnclaimedDraftEditAndResendRequest - a model defined in OpenAPI - - Args: - client_id (str): Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - editor_options (SubEditorOptions): [optional] # noqa: E501 - is_for_embedded_signing (bool): The request created from this draft will also be signable in embedded mode if set to `true`.. [optional] # noqa: E501 - requester_email_address (str): The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used.. [optional] # noqa: E501 - requesting_redirect_url (str): The URL you want signers redirected to after they successfully request a signature.. [optional] # noqa: E501 - show_progress_stepper (bool): When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.. [optional] if omitted the server will use the default value of True # noqa: E501 - signing_redirect_url (str): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.. [optional] if omitted the server will use the default value of False # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/unclaimed_draft_response.py b/dropbox_sign/model/unclaimed_draft_response.py deleted file mode 100644 index 158e96f..0000000 --- a/dropbox_sign/model/unclaimed_draft_response.py +++ /dev/null @@ -1,343 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class UnclaimedDraftResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'signature_request_id': (str, none_type,), # noqa: E501 - 'claim_url': (str,), # noqa: E501 - 'signing_redirect_url': (str, none_type,), # noqa: E501 - 'requesting_redirect_url': (str, none_type,), # noqa: E501 - 'expires_at': (int, none_type,), # noqa: E501 - 'test_mode': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> UnclaimedDraftResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[UnclaimedDraftResponse], - _check_type=True, - ) - - attribute_map = { - 'signature_request_id': 'signature_request_id', # noqa: E501 - 'claim_url': 'claim_url', # noqa: E501 - 'signing_redirect_url': 'signing_redirect_url', # noqa: E501 - 'requesting_redirect_url': 'requesting_redirect_url', # noqa: E501 - 'expires_at': 'expires_at', # noqa: E501 - 'test_mode': 'test_mode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def signature_request_id(self) -> Optional[str]: - return self.get("signature_request_id") - - @signature_request_id.setter - def signature_request_id(self, value: Optional[str]): - setattr(self, "signature_request_id", value) - - @property - def claim_url(self) -> str: - return self.get("claim_url") - - @claim_url.setter - def claim_url(self, value: str): - setattr(self, "claim_url", value) - - @property - def signing_redirect_url(self) -> Optional[str]: - return self.get("signing_redirect_url") - - @signing_redirect_url.setter - def signing_redirect_url(self, value: Optional[str]): - setattr(self, "signing_redirect_url", value) - - @property - def requesting_redirect_url(self) -> Optional[str]: - return self.get("requesting_redirect_url") - - @requesting_redirect_url.setter - def requesting_redirect_url(self, value: Optional[str]): - setattr(self, "requesting_redirect_url", value) - - @property - def expires_at(self) -> Optional[int]: - return self.get("expires_at") - - @expires_at.setter - def expires_at(self, value: Optional[int]): - setattr(self, "expires_at", value) - - @property - def test_mode(self) -> bool: - return self.get("test_mode") - - @test_mode.setter - def test_mode(self, value: bool): - setattr(self, "test_mode", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """UnclaimedDraftResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_request_id (str, none_type): The ID of the signature request that is represented by this UnclaimedDraft.. [optional] # noqa: E501 - claim_url (str): The URL to be used to claim this UnclaimedDraft.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - requesting_redirect_url (str, none_type): The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.).. [optional] # noqa: E501 - expires_at (int, none_type): When the link expires.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test draft. Signature requests made from test drafts have no legal value.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """UnclaimedDraftResponse - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - signature_request_id (str, none_type): The ID of the signature request that is represented by this UnclaimedDraft.. [optional] # noqa: E501 - claim_url (str): The URL to be used to claim this UnclaimedDraft.. [optional] # noqa: E501 - signing_redirect_url (str, none_type): The URL you want signers redirected to after they successfully sign.. [optional] # noqa: E501 - requesting_redirect_url (str, none_type): The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.).. [optional] # noqa: E501 - expires_at (int, none_type): When the link expires.. [optional] # noqa: E501 - test_mode (bool): Whether this is a test draft. Signature requests made from test drafts have no legal value.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model/warning_response.py b/dropbox_sign/model/warning_response.py deleted file mode 100644 index eb62766..0000000 --- a/dropbox_sign/model/warning_response.py +++ /dev/null @@ -1,303 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from dropbox_sign import ApiClient -from dropbox_sign.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from dropbox_sign.exceptions import ApiAttributeError - - - -class WarningResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'warning_msg': (str,), # noqa: E501 - 'warning_name': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - @staticmethod - def init(data: any) -> WarningResponse: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[WarningResponse], - _check_type=True, - ) - - attribute_map = { - 'warning_msg': 'warning_msg', # noqa: E501 - 'warning_name': 'warning_name', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @property - def warning_msg(self) -> str: - return self.get("warning_msg") - - @warning_msg.setter - def warning_msg(self, value: str): - setattr(self, "warning_msg", value) - - @property - def warning_name(self) -> str: - return self.get("warning_name") - - @warning_name.setter - def warning_name(self, value: str): - setattr(self, "warning_name", value) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, warning_msg, warning_name, *args, **kwargs): # noqa: E501 - """WarningResponse - a model defined in OpenAPI - - Args: - warning_msg (str): Warning message - warning_name (str): Warning name - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.warning_msg = warning_msg - self.warning_name = warning_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, warning_msg, warning_name, *args, **kwargs): # noqa: E501 - """WarningResponse - a model defined in OpenAPI - - Args: - warning_msg (str): Warning message - warning_name (str): Warning name - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.warning_msg = warning_msg - self.warning_name = warning_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/dropbox_sign/model_utils.py b/dropbox_sign/model_utils.py deleted file mode 100644 index 7b89acc..0000000 --- a/dropbox_sign/model_utils.py +++ /dev/null @@ -1,2042 +0,0 @@ -""" - Dropbox Sign API - - Dropbox Sign v3 API # noqa: E501 - - The version of the OpenAPI document: 3.0.0 - Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" - - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile - -from dateutil.parser import parse - -from dropbox_sign.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - self.__dict__['_data_store'][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.__getitem__(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return new_cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst - - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - return None - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - return None - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - # leave ints as-is - if type(current_item) is int and required_type_class_simplified == current_type_simple: - results_classes.append(int) - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - - # allow casting int to string - if type(current_item) is int: - results_classes.append(str) - - if type(current_item) is none_type: - results_classes.append(none_type) - return results_classes - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - elif data is None: - # This SDK does not support nullable params unless they are explicitly marked as nullable - return data - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - if input_value is None: - return input_value - - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if configuration: - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item - - model_instances = [model_instance] - if model_instance._composed_schemas: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - result[attr] = model_to_dict_recursive(value, serialize, extract_item) - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def model_to_dict_recursive(value, serialize, extract_item): - if isinstance(value, list): - res = [] - - for v in value: - res.append(model_to_dict_recursive(v, serialize, extract_item)) - - return res - elif isinstance(value, dict): - return dict(map( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - return value.value - elif hasattr(value, '_data_store'): - return model_to_dict(value, serialize=serialize) - elif isinstance(value, io.BufferedReader): - return value.name - else: - return value - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - if 'allOf' in self._composed_schemas.keys(): - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data(**model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data(model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + composed_instances - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] \ No newline at end of file diff --git a/dropbox_sign/models/__init__.py b/dropbox_sign/models/__init__.py index 81a97b0..ed95797 100644 --- a/dropbox_sign/models/__init__.py +++ b/dropbox_sign/models/__init__.py @@ -1,183 +1,200 @@ +# coding: utf-8 + # flake8: noqa +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from dropbox_sign.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) -from dropbox_sign.model.account_create_request import AccountCreateRequest -from dropbox_sign.model.account_create_response import AccountCreateResponse -from dropbox_sign.model.account_get_response import AccountGetResponse -from dropbox_sign.model.account_response import AccountResponse -from dropbox_sign.model.account_response_quotas import AccountResponseQuotas -from dropbox_sign.model.account_response_usage import AccountResponseUsage -from dropbox_sign.model.account_update_request import AccountUpdateRequest -from dropbox_sign.model.account_verify_request import AccountVerifyRequest -from dropbox_sign.model.account_verify_response import AccountVerifyResponse -from dropbox_sign.model.account_verify_response_account import AccountVerifyResponseAccount -from dropbox_sign.model.api_app_create_request import ApiAppCreateRequest -from dropbox_sign.model.api_app_get_response import ApiAppGetResponse -from dropbox_sign.model.api_app_list_response import ApiAppListResponse -from dropbox_sign.model.api_app_response import ApiAppResponse -from dropbox_sign.model.api_app_response_o_auth import ApiAppResponseOAuth -from dropbox_sign.model.api_app_response_options import ApiAppResponseOptions -from dropbox_sign.model.api_app_response_owner_account import ApiAppResponseOwnerAccount -from dropbox_sign.model.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions -from dropbox_sign.model.api_app_update_request import ApiAppUpdateRequest -from dropbox_sign.model.bulk_send_job_get_response import BulkSendJobGetResponse -from dropbox_sign.model.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests -from dropbox_sign.model.bulk_send_job_list_response import BulkSendJobListResponse -from dropbox_sign.model.bulk_send_job_response import BulkSendJobResponse -from dropbox_sign.model.bulk_send_job_send_response import BulkSendJobSendResponse -from dropbox_sign.model.embedded_edit_url_request import EmbeddedEditUrlRequest -from dropbox_sign.model.embedded_edit_url_response import EmbeddedEditUrlResponse -from dropbox_sign.model.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded -from dropbox_sign.model.embedded_sign_url_response import EmbeddedSignUrlResponse -from dropbox_sign.model.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded -from dropbox_sign.model.error_response import ErrorResponse -from dropbox_sign.model.error_response_error import ErrorResponseError -from dropbox_sign.model.event_callback_request import EventCallbackRequest -from dropbox_sign.model.event_callback_request_event import EventCallbackRequestEvent -from dropbox_sign.model.event_callback_request_event_metadata import EventCallbackRequestEventMetadata -from dropbox_sign.model.file_response import FileResponse -from dropbox_sign.model.file_response_data_uri import FileResponseDataUri -from dropbox_sign.model.list_info_response import ListInfoResponse -from dropbox_sign.model.o_auth_token_generate_request import OAuthTokenGenerateRequest -from dropbox_sign.model.o_auth_token_refresh_request import OAuthTokenRefreshRequest -from dropbox_sign.model.o_auth_token_response import OAuthTokenResponse -from dropbox_sign.model.report_create_request import ReportCreateRequest -from dropbox_sign.model.report_create_response import ReportCreateResponse -from dropbox_sign.model.report_response import ReportResponse -from dropbox_sign.model.signature_request_bulk_create_embedded_with_template_request import SignatureRequestBulkCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.signature_request_bulk_send_with_template_request import SignatureRequestBulkSendWithTemplateRequest -from dropbox_sign.model.signature_request_create_embedded_request import SignatureRequestCreateEmbeddedRequest -from dropbox_sign.model.signature_request_create_embedded_with_template_request import SignatureRequestCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.signature_request_get_response import SignatureRequestGetResponse -from dropbox_sign.model.signature_request_list_response import SignatureRequestListResponse -from dropbox_sign.model.signature_request_remind_request import SignatureRequestRemindRequest -from dropbox_sign.model.signature_request_response import SignatureRequestResponse -from dropbox_sign.model.signature_request_response_attachment import SignatureRequestResponseAttachment -from dropbox_sign.model.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase -from dropbox_sign.model.signature_request_response_custom_field_checkbox import SignatureRequestResponseCustomFieldCheckbox -from dropbox_sign.model.signature_request_response_custom_field_text import SignatureRequestResponseCustomFieldText -from dropbox_sign.model.signature_request_response_custom_field_type_enum import SignatureRequestResponseCustomFieldTypeEnum -from dropbox_sign.model.signature_request_response_data_base import SignatureRequestResponseDataBase -from dropbox_sign.model.signature_request_response_data_type_enum import SignatureRequestResponseDataTypeEnum -from dropbox_sign.model.signature_request_response_data_value_checkbox import SignatureRequestResponseDataValueCheckbox -from dropbox_sign.model.signature_request_response_data_value_checkbox_merge import SignatureRequestResponseDataValueCheckboxMerge -from dropbox_sign.model.signature_request_response_data_value_date_signed import SignatureRequestResponseDataValueDateSigned -from dropbox_sign.model.signature_request_response_data_value_dropdown import SignatureRequestResponseDataValueDropdown -from dropbox_sign.model.signature_request_response_data_value_initials import SignatureRequestResponseDataValueInitials -from dropbox_sign.model.signature_request_response_data_value_radio import SignatureRequestResponseDataValueRadio -from dropbox_sign.model.signature_request_response_data_value_signature import SignatureRequestResponseDataValueSignature -from dropbox_sign.model.signature_request_response_data_value_text import SignatureRequestResponseDataValueText -from dropbox_sign.model.signature_request_response_data_value_text_merge import SignatureRequestResponseDataValueTextMerge -from dropbox_sign.model.signature_request_response_signatures import SignatureRequestResponseSignatures -from dropbox_sign.model.signature_request_send_request import SignatureRequestSendRequest -from dropbox_sign.model.signature_request_send_with_template_request import SignatureRequestSendWithTemplateRequest -from dropbox_sign.model.signature_request_update_request import SignatureRequestUpdateRequest -from dropbox_sign.model.sub_attachment import SubAttachment -from dropbox_sign.model.sub_bulk_signer_list import SubBulkSignerList -from dropbox_sign.model.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField -from dropbox_sign.model.sub_cc import SubCC -from dropbox_sign.model.sub_custom_field import SubCustomField -from dropbox_sign.model.sub_editor_options import SubEditorOptions -from dropbox_sign.model.sub_field_options import SubFieldOptions -from dropbox_sign.model.sub_form_field_group import SubFormFieldGroup -from dropbox_sign.model.sub_form_field_rule import SubFormFieldRule -from dropbox_sign.model.sub_form_field_rule_action import SubFormFieldRuleAction -from dropbox_sign.model.sub_form_field_rule_trigger import SubFormFieldRuleTrigger -from dropbox_sign.model.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase -from dropbox_sign.model.sub_form_fields_per_document_checkbox import SubFormFieldsPerDocumentCheckbox -from dropbox_sign.model.sub_form_fields_per_document_checkbox_merge import SubFormFieldsPerDocumentCheckboxMerge -from dropbox_sign.model.sub_form_fields_per_document_date_signed import SubFormFieldsPerDocumentDateSigned -from dropbox_sign.model.sub_form_fields_per_document_dropdown import SubFormFieldsPerDocumentDropdown -from dropbox_sign.model.sub_form_fields_per_document_font_enum import SubFormFieldsPerDocumentFontEnum -from dropbox_sign.model.sub_form_fields_per_document_hyperlink import SubFormFieldsPerDocumentHyperlink -from dropbox_sign.model.sub_form_fields_per_document_initials import SubFormFieldsPerDocumentInitials -from dropbox_sign.model.sub_form_fields_per_document_radio import SubFormFieldsPerDocumentRadio -from dropbox_sign.model.sub_form_fields_per_document_signature import SubFormFieldsPerDocumentSignature -from dropbox_sign.model.sub_form_fields_per_document_text import SubFormFieldsPerDocumentText -from dropbox_sign.model.sub_form_fields_per_document_text_merge import SubFormFieldsPerDocumentTextMerge -from dropbox_sign.model.sub_form_fields_per_document_type_enum import SubFormFieldsPerDocumentTypeEnum -from dropbox_sign.model.sub_merge_field import SubMergeField -from dropbox_sign.model.sub_o_auth import SubOAuth -from dropbox_sign.model.sub_options import SubOptions -from dropbox_sign.model.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners -from dropbox_sign.model.sub_signature_request_signer import SubSignatureRequestSigner -from dropbox_sign.model.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner -from dropbox_sign.model.sub_signing_options import SubSigningOptions -from dropbox_sign.model.sub_team_response import SubTeamResponse -from dropbox_sign.model.sub_template_role import SubTemplateRole -from dropbox_sign.model.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner -from dropbox_sign.model.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner -from dropbox_sign.model.sub_white_labeling_options import SubWhiteLabelingOptions -from dropbox_sign.model.team_add_member_request import TeamAddMemberRequest -from dropbox_sign.model.team_create_request import TeamCreateRequest -from dropbox_sign.model.team_get_info_response import TeamGetInfoResponse -from dropbox_sign.model.team_get_response import TeamGetResponse -from dropbox_sign.model.team_info_response import TeamInfoResponse -from dropbox_sign.model.team_invite_response import TeamInviteResponse -from dropbox_sign.model.team_invites_response import TeamInvitesResponse -from dropbox_sign.model.team_member_response import TeamMemberResponse -from dropbox_sign.model.team_members_response import TeamMembersResponse -from dropbox_sign.model.team_parent_response import TeamParentResponse -from dropbox_sign.model.team_remove_member_request import TeamRemoveMemberRequest -from dropbox_sign.model.team_response import TeamResponse -from dropbox_sign.model.team_sub_teams_response import TeamSubTeamsResponse -from dropbox_sign.model.team_update_request import TeamUpdateRequest -from dropbox_sign.model.template_add_user_request import TemplateAddUserRequest -from dropbox_sign.model.template_create_embedded_draft_request import TemplateCreateEmbeddedDraftRequest -from dropbox_sign.model.template_create_embedded_draft_response import TemplateCreateEmbeddedDraftResponse -from dropbox_sign.model.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate -from dropbox_sign.model.template_create_request import TemplateCreateRequest -from dropbox_sign.model.template_create_response import TemplateCreateResponse -from dropbox_sign.model.template_create_response_template import TemplateCreateResponseTemplate -from dropbox_sign.model.template_edit_response import TemplateEditResponse -from dropbox_sign.model.template_get_response import TemplateGetResponse -from dropbox_sign.model.template_list_response import TemplateListResponse -from dropbox_sign.model.template_remove_user_request import TemplateRemoveUserRequest -from dropbox_sign.model.template_response import TemplateResponse -from dropbox_sign.model.template_response_account import TemplateResponseAccount -from dropbox_sign.model.template_response_account_quota import TemplateResponseAccountQuota -from dropbox_sign.model.template_response_cc_role import TemplateResponseCCRole -from dropbox_sign.model.template_response_document import TemplateResponseDocument -from dropbox_sign.model.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase -from dropbox_sign.model.template_response_document_custom_field_checkbox import TemplateResponseDocumentCustomFieldCheckbox -from dropbox_sign.model.template_response_document_custom_field_text import TemplateResponseDocumentCustomFieldText -from dropbox_sign.model.template_response_document_field_group import TemplateResponseDocumentFieldGroup -from dropbox_sign.model.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule -from dropbox_sign.model.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase -from dropbox_sign.model.template_response_document_form_field_checkbox import TemplateResponseDocumentFormFieldCheckbox -from dropbox_sign.model.template_response_document_form_field_date_signed import TemplateResponseDocumentFormFieldDateSigned -from dropbox_sign.model.template_response_document_form_field_dropdown import TemplateResponseDocumentFormFieldDropdown -from dropbox_sign.model.template_response_document_form_field_hyperlink import TemplateResponseDocumentFormFieldHyperlink -from dropbox_sign.model.template_response_document_form_field_initials import TemplateResponseDocumentFormFieldInitials -from dropbox_sign.model.template_response_document_form_field_radio import TemplateResponseDocumentFormFieldRadio -from dropbox_sign.model.template_response_document_form_field_signature import TemplateResponseDocumentFormFieldSignature -from dropbox_sign.model.template_response_document_form_field_text import TemplateResponseDocumentFormFieldText -from dropbox_sign.model.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase -from dropbox_sign.model.template_response_document_static_field_checkbox import TemplateResponseDocumentStaticFieldCheckbox -from dropbox_sign.model.template_response_document_static_field_date_signed import TemplateResponseDocumentStaticFieldDateSigned -from dropbox_sign.model.template_response_document_static_field_dropdown import TemplateResponseDocumentStaticFieldDropdown -from dropbox_sign.model.template_response_document_static_field_hyperlink import TemplateResponseDocumentStaticFieldHyperlink -from dropbox_sign.model.template_response_document_static_field_initials import TemplateResponseDocumentStaticFieldInitials -from dropbox_sign.model.template_response_document_static_field_radio import TemplateResponseDocumentStaticFieldRadio -from dropbox_sign.model.template_response_document_static_field_signature import TemplateResponseDocumentStaticFieldSignature -from dropbox_sign.model.template_response_document_static_field_text import TemplateResponseDocumentStaticFieldText -from dropbox_sign.model.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength -from dropbox_sign.model.template_response_signer_role import TemplateResponseSignerRole -from dropbox_sign.model.template_update_files_request import TemplateUpdateFilesRequest -from dropbox_sign.model.template_update_files_response import TemplateUpdateFilesResponse -from dropbox_sign.model.template_update_files_response_template import TemplateUpdateFilesResponseTemplate -from dropbox_sign.model.unclaimed_draft_create_embedded_request import UnclaimedDraftCreateEmbeddedRequest -from dropbox_sign.model.unclaimed_draft_create_embedded_with_template_request import UnclaimedDraftCreateEmbeddedWithTemplateRequest -from dropbox_sign.model.unclaimed_draft_create_request import UnclaimedDraftCreateRequest -from dropbox_sign.model.unclaimed_draft_create_response import UnclaimedDraftCreateResponse -from dropbox_sign.model.unclaimed_draft_edit_and_resend_request import UnclaimedDraftEditAndResendRequest -from dropbox_sign.model.unclaimed_draft_response import UnclaimedDraftResponse -from dropbox_sign.model.warning_response import WarningResponse +# import models into model package +from dropbox_sign.models.account_create_request import AccountCreateRequest +from dropbox_sign.models.account_create_response import AccountCreateResponse +from dropbox_sign.models.account_get_response import AccountGetResponse +from dropbox_sign.models.account_response import AccountResponse +from dropbox_sign.models.account_response_quotas import AccountResponseQuotas +from dropbox_sign.models.account_response_usage import AccountResponseUsage +from dropbox_sign.models.account_update_request import AccountUpdateRequest +from dropbox_sign.models.account_verify_request import AccountVerifyRequest +from dropbox_sign.models.account_verify_response import AccountVerifyResponse +from dropbox_sign.models.account_verify_response_account import AccountVerifyResponseAccount +from dropbox_sign.models.api_app_create_request import ApiAppCreateRequest +from dropbox_sign.models.api_app_get_response import ApiAppGetResponse +from dropbox_sign.models.api_app_list_response import ApiAppListResponse +from dropbox_sign.models.api_app_response import ApiAppResponse +from dropbox_sign.models.api_app_response_o_auth import ApiAppResponseOAuth +from dropbox_sign.models.api_app_response_options import ApiAppResponseOptions +from dropbox_sign.models.api_app_response_owner_account import ApiAppResponseOwnerAccount +from dropbox_sign.models.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions +from dropbox_sign.models.api_app_update_request import ApiAppUpdateRequest +from dropbox_sign.models.bulk_send_job_get_response import BulkSendJobGetResponse +from dropbox_sign.models.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests +from dropbox_sign.models.bulk_send_job_list_response import BulkSendJobListResponse +from dropbox_sign.models.bulk_send_job_response import BulkSendJobResponse +from dropbox_sign.models.bulk_send_job_send_response import BulkSendJobSendResponse +from dropbox_sign.models.embedded_edit_url_request import EmbeddedEditUrlRequest +from dropbox_sign.models.embedded_edit_url_response import EmbeddedEditUrlResponse +from dropbox_sign.models.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded +from dropbox_sign.models.embedded_sign_url_response import EmbeddedSignUrlResponse +from dropbox_sign.models.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded +from dropbox_sign.models.error_response import ErrorResponse +from dropbox_sign.models.error_response_error import ErrorResponseError +from dropbox_sign.models.event_callback_request import EventCallbackRequest +from dropbox_sign.models.event_callback_request_event import EventCallbackRequestEvent +from dropbox_sign.models.event_callback_request_event_metadata import EventCallbackRequestEventMetadata +from dropbox_sign.models.fax_line_add_user_request import FaxLineAddUserRequest +from dropbox_sign.models.fax_line_area_code_get_country_enum import FaxLineAreaCodeGetCountryEnum +from dropbox_sign.models.fax_line_area_code_get_province_enum import FaxLineAreaCodeGetProvinceEnum +from dropbox_sign.models.fax_line_area_code_get_response import FaxLineAreaCodeGetResponse +from dropbox_sign.models.fax_line_area_code_get_state_enum import FaxLineAreaCodeGetStateEnum +from dropbox_sign.models.fax_line_create_request import FaxLineCreateRequest +from dropbox_sign.models.fax_line_delete_request import FaxLineDeleteRequest +from dropbox_sign.models.fax_line_list_response import FaxLineListResponse +from dropbox_sign.models.fax_line_remove_user_request import FaxLineRemoveUserRequest +from dropbox_sign.models.fax_line_response import FaxLineResponse +from dropbox_sign.models.fax_line_response_fax_line import FaxLineResponseFaxLine +from dropbox_sign.models.file_response import FileResponse +from dropbox_sign.models.file_response_data_uri import FileResponseDataUri +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.o_auth_token_generate_request import OAuthTokenGenerateRequest +from dropbox_sign.models.o_auth_token_refresh_request import OAuthTokenRefreshRequest +from dropbox_sign.models.o_auth_token_response import OAuthTokenResponse +from dropbox_sign.models.report_create_request import ReportCreateRequest +from dropbox_sign.models.report_create_response import ReportCreateResponse +from dropbox_sign.models.report_response import ReportResponse +from dropbox_sign.models.signature_request_bulk_create_embedded_with_template_request import SignatureRequestBulkCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_bulk_send_with_template_request import SignatureRequestBulkSendWithTemplateRequest +from dropbox_sign.models.signature_request_create_embedded_request import SignatureRequestCreateEmbeddedRequest +from dropbox_sign.models.signature_request_create_embedded_with_template_request import SignatureRequestCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.signature_request_get_response import SignatureRequestGetResponse +from dropbox_sign.models.signature_request_list_response import SignatureRequestListResponse +from dropbox_sign.models.signature_request_remind_request import SignatureRequestRemindRequest +from dropbox_sign.models.signature_request_response import SignatureRequestResponse +from dropbox_sign.models.signature_request_response_attachment import SignatureRequestResponseAttachment +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from dropbox_sign.models.signature_request_response_custom_field_checkbox import SignatureRequestResponseCustomFieldCheckbox +from dropbox_sign.models.signature_request_response_custom_field_text import SignatureRequestResponseCustomFieldText +from dropbox_sign.models.signature_request_response_custom_field_type_enum import SignatureRequestResponseCustomFieldTypeEnum +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from dropbox_sign.models.signature_request_response_data_type_enum import SignatureRequestResponseDataTypeEnum +from dropbox_sign.models.signature_request_response_data_value_checkbox import SignatureRequestResponseDataValueCheckbox +from dropbox_sign.models.signature_request_response_data_value_checkbox_merge import SignatureRequestResponseDataValueCheckboxMerge +from dropbox_sign.models.signature_request_response_data_value_date_signed import SignatureRequestResponseDataValueDateSigned +from dropbox_sign.models.signature_request_response_data_value_dropdown import SignatureRequestResponseDataValueDropdown +from dropbox_sign.models.signature_request_response_data_value_initials import SignatureRequestResponseDataValueInitials +from dropbox_sign.models.signature_request_response_data_value_radio import SignatureRequestResponseDataValueRadio +from dropbox_sign.models.signature_request_response_data_value_signature import SignatureRequestResponseDataValueSignature +from dropbox_sign.models.signature_request_response_data_value_text import SignatureRequestResponseDataValueText +from dropbox_sign.models.signature_request_response_data_value_text_merge import SignatureRequestResponseDataValueTextMerge +from dropbox_sign.models.signature_request_response_signatures import SignatureRequestResponseSignatures +from dropbox_sign.models.signature_request_send_request import SignatureRequestSendRequest +from dropbox_sign.models.signature_request_send_with_template_request import SignatureRequestSendWithTemplateRequest +from dropbox_sign.models.signature_request_update_request import SignatureRequestUpdateRequest +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_bulk_signer_list import SubBulkSignerList +from dropbox_sign.models.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_field_rule_action import SubFormFieldRuleAction +from dropbox_sign.models.sub_form_field_rule_trigger import SubFormFieldRuleTrigger +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_form_fields_per_document_checkbox import SubFormFieldsPerDocumentCheckbox +from dropbox_sign.models.sub_form_fields_per_document_checkbox_merge import SubFormFieldsPerDocumentCheckboxMerge +from dropbox_sign.models.sub_form_fields_per_document_date_signed import SubFormFieldsPerDocumentDateSigned +from dropbox_sign.models.sub_form_fields_per_document_dropdown import SubFormFieldsPerDocumentDropdown +from dropbox_sign.models.sub_form_fields_per_document_font_enum import SubFormFieldsPerDocumentFontEnum +from dropbox_sign.models.sub_form_fields_per_document_hyperlink import SubFormFieldsPerDocumentHyperlink +from dropbox_sign.models.sub_form_fields_per_document_initials import SubFormFieldsPerDocumentInitials +from dropbox_sign.models.sub_form_fields_per_document_radio import SubFormFieldsPerDocumentRadio +from dropbox_sign.models.sub_form_fields_per_document_signature import SubFormFieldsPerDocumentSignature +from dropbox_sign.models.sub_form_fields_per_document_text import SubFormFieldsPerDocumentText +from dropbox_sign.models.sub_form_fields_per_document_text_merge import SubFormFieldsPerDocumentTextMerge +from dropbox_sign.models.sub_form_fields_per_document_type_enum import SubFormFieldsPerDocumentTypeEnum +from dropbox_sign.models.sub_merge_field import SubMergeField +from dropbox_sign.models.sub_o_auth import SubOAuth +from dropbox_sign.models.sub_options import SubOptions +from dropbox_sign.models.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners +from dropbox_sign.models.sub_signature_request_signer import SubSignatureRequestSigner +from dropbox_sign.models.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from dropbox_sign.models.sub_team_response import SubTeamResponse +from dropbox_sign.models.sub_template_role import SubTemplateRole +from dropbox_sign.models.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner +from dropbox_sign.models.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner +from dropbox_sign.models.sub_white_labeling_options import SubWhiteLabelingOptions +from dropbox_sign.models.team_add_member_request import TeamAddMemberRequest +from dropbox_sign.models.team_create_request import TeamCreateRequest +from dropbox_sign.models.team_get_info_response import TeamGetInfoResponse +from dropbox_sign.models.team_get_response import TeamGetResponse +from dropbox_sign.models.team_info_response import TeamInfoResponse +from dropbox_sign.models.team_invite_response import TeamInviteResponse +from dropbox_sign.models.team_invites_response import TeamInvitesResponse +from dropbox_sign.models.team_member_response import TeamMemberResponse +from dropbox_sign.models.team_members_response import TeamMembersResponse +from dropbox_sign.models.team_parent_response import TeamParentResponse +from dropbox_sign.models.team_remove_member_request import TeamRemoveMemberRequest +from dropbox_sign.models.team_response import TeamResponse +from dropbox_sign.models.team_sub_teams_response import TeamSubTeamsResponse +from dropbox_sign.models.team_update_request import TeamUpdateRequest +from dropbox_sign.models.template_add_user_request import TemplateAddUserRequest +from dropbox_sign.models.template_create_embedded_draft_request import TemplateCreateEmbeddedDraftRequest +from dropbox_sign.models.template_create_embedded_draft_response import TemplateCreateEmbeddedDraftResponse +from dropbox_sign.models.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate +from dropbox_sign.models.template_create_request import TemplateCreateRequest +from dropbox_sign.models.template_create_response import TemplateCreateResponse +from dropbox_sign.models.template_create_response_template import TemplateCreateResponseTemplate +from dropbox_sign.models.template_edit_response import TemplateEditResponse +from dropbox_sign.models.template_get_response import TemplateGetResponse +from dropbox_sign.models.template_list_response import TemplateListResponse +from dropbox_sign.models.template_remove_user_request import TemplateRemoveUserRequest +from dropbox_sign.models.template_response import TemplateResponse +from dropbox_sign.models.template_response_account import TemplateResponseAccount +from dropbox_sign.models.template_response_account_quota import TemplateResponseAccountQuota +from dropbox_sign.models.template_response_cc_role import TemplateResponseCCRole +from dropbox_sign.models.template_response_document import TemplateResponseDocument +from dropbox_sign.models.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from dropbox_sign.models.template_response_document_custom_field_checkbox import TemplateResponseDocumentCustomFieldCheckbox +from dropbox_sign.models.template_response_document_custom_field_text import TemplateResponseDocumentCustomFieldText +from dropbox_sign.models.template_response_document_field_group import TemplateResponseDocumentFieldGroup +from dropbox_sign.models.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_document_form_field_checkbox import TemplateResponseDocumentFormFieldCheckbox +from dropbox_sign.models.template_response_document_form_field_date_signed import TemplateResponseDocumentFormFieldDateSigned +from dropbox_sign.models.template_response_document_form_field_dropdown import TemplateResponseDocumentFormFieldDropdown +from dropbox_sign.models.template_response_document_form_field_hyperlink import TemplateResponseDocumentFormFieldHyperlink +from dropbox_sign.models.template_response_document_form_field_initials import TemplateResponseDocumentFormFieldInitials +from dropbox_sign.models.template_response_document_form_field_radio import TemplateResponseDocumentFormFieldRadio +from dropbox_sign.models.template_response_document_form_field_signature import TemplateResponseDocumentFormFieldSignature +from dropbox_sign.models.template_response_document_form_field_text import TemplateResponseDocumentFormFieldText +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from dropbox_sign.models.template_response_document_static_field_checkbox import TemplateResponseDocumentStaticFieldCheckbox +from dropbox_sign.models.template_response_document_static_field_date_signed import TemplateResponseDocumentStaticFieldDateSigned +from dropbox_sign.models.template_response_document_static_field_dropdown import TemplateResponseDocumentStaticFieldDropdown +from dropbox_sign.models.template_response_document_static_field_hyperlink import TemplateResponseDocumentStaticFieldHyperlink +from dropbox_sign.models.template_response_document_static_field_initials import TemplateResponseDocumentStaticFieldInitials +from dropbox_sign.models.template_response_document_static_field_radio import TemplateResponseDocumentStaticFieldRadio +from dropbox_sign.models.template_response_document_static_field_signature import TemplateResponseDocumentStaticFieldSignature +from dropbox_sign.models.template_response_document_static_field_text import TemplateResponseDocumentStaticFieldText +from dropbox_sign.models.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength +from dropbox_sign.models.template_response_signer_role import TemplateResponseSignerRole +from dropbox_sign.models.template_update_files_request import TemplateUpdateFilesRequest +from dropbox_sign.models.template_update_files_response import TemplateUpdateFilesResponse +from dropbox_sign.models.template_update_files_response_template import TemplateUpdateFilesResponseTemplate +from dropbox_sign.models.unclaimed_draft_create_embedded_request import UnclaimedDraftCreateEmbeddedRequest +from dropbox_sign.models.unclaimed_draft_create_embedded_with_template_request import UnclaimedDraftCreateEmbeddedWithTemplateRequest +from dropbox_sign.models.unclaimed_draft_create_request import UnclaimedDraftCreateRequest +from dropbox_sign.models.unclaimed_draft_create_response import UnclaimedDraftCreateResponse +from dropbox_sign.models.unclaimed_draft_edit_and_resend_request import UnclaimedDraftEditAndResendRequest +from dropbox_sign.models.unclaimed_draft_response import UnclaimedDraftResponse +from dropbox_sign.models.warning_response import WarningResponse diff --git a/dropbox_sign/models/account_create_request.py b/dropbox_sign/models/account_create_request.py new file mode 100644 index 0000000..698d4ba --- /dev/null +++ b/dropbox_sign/models/account_create_request.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountCreateRequest(BaseModel): + """ + AccountCreateRequest + """ # noqa: E501 + email_address: StrictStr = Field(description="The email address which will be associated with the new Account.") + client_id: Optional[StrictStr] = Field(default=None, description="Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization)") + client_secret: Optional[StrictStr] = Field(default=None, description="Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization)") + locale: Optional[StrictStr] = Field(default=None, description="The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") + __properties: ClassVar[List[str]] = ["email_address", "client_id", "client_secret", "locale"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountCreateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address"), + "client_id": obj.get("client_id"), + "client_secret": obj.get("client_secret"), + "locale": obj.get("locale") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "email_address": "(str,)", + "client_id": "(str,)", + "client_secret": "(str,)", + "locale": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/account_create_response.py b/dropbox_sign/models/account_create_response.py new file mode 100644 index 0000000..d25a2ad --- /dev/null +++ b/dropbox_sign/models/account_create_response.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.account_response import AccountResponse +from dropbox_sign.models.o_auth_token_response import OAuthTokenResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountCreateResponse(BaseModel): + """ + AccountCreateResponse + """ # noqa: E501 + account: AccountResponse + oauth_data: Optional[OAuthTokenResponse] = None + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["account", "oauth_data", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountCreateResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of account + if self.account: + _dict['account'] = self.account.to_dict() + # override the default output from pydantic by calling `to_dict()` of oauth_data + if self.oauth_data: + _dict['oauth_data'] = self.oauth_data.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountCreateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account": AccountResponse.from_dict(obj["account"]) if obj.get("account") is not None else None, + "oauth_data": OAuthTokenResponse.from_dict(obj["oauth_data"]) if obj.get("oauth_data") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account": "(AccountResponse,)", + "oauth_data": "(OAuthTokenResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/account_get_response.py b/dropbox_sign/models/account_get_response.py new file mode 100644 index 0000000..6f21ab6 --- /dev/null +++ b/dropbox_sign/models/account_get_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.account_response import AccountResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountGetResponse(BaseModel): + """ + AccountGetResponse + """ # noqa: E501 + account: AccountResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["account", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountGetResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of account + if self.account: + _dict['account'] = self.account.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account": AccountResponse.from_dict(obj["account"]) if obj.get("account") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account": "(AccountResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/account_response.py b/dropbox_sign/models/account_response.py new file mode 100644 index 0000000..48fc371 --- /dev/null +++ b/dropbox_sign/models/account_response.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.account_response_quotas import AccountResponseQuotas +from dropbox_sign.models.account_response_usage import AccountResponseUsage +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountResponse(BaseModel): + """ + AccountResponse + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The ID of the Account") + email_address: Optional[StrictStr] = Field(default=None, description="The email address associated with the Account.") + is_locked: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has been locked out of their account by a team admin.") + is_paid_hs: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has a paid Dropbox Sign account.") + is_paid_hf: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has a paid HelloFax account.") + quotas: Optional[AccountResponseQuotas] = None + callback_url: Optional[StrictStr] = Field(default=None, description="The URL that Dropbox Sign events will `POST` to.") + role_code: Optional[StrictStr] = Field(default=None, description="The membership role for the team.") + team_id: Optional[StrictStr] = Field(default=None, description="The id of the team account belongs to.") + locale: Optional[StrictStr] = Field(default=None, description="The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") + usage: Optional[AccountResponseUsage] = None + __properties: ClassVar[List[str]] = ["account_id", "email_address", "is_locked", "is_paid_hs", "is_paid_hf", "quotas", "callback_url", "role_code", "team_id", "locale", "usage"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of quotas + if self.quotas: + _dict['quotas'] = self.quotas.to_dict() + # override the default output from pydantic by calling `to_dict()` of usage + if self.usage: + _dict['usage'] = self.usage.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "is_locked": obj.get("is_locked"), + "is_paid_hs": obj.get("is_paid_hs"), + "is_paid_hf": obj.get("is_paid_hf"), + "quotas": AccountResponseQuotas.from_dict(obj["quotas"]) if obj.get("quotas") is not None else None, + "callback_url": obj.get("callback_url"), + "role_code": obj.get("role_code"), + "team_id": obj.get("team_id"), + "locale": obj.get("locale"), + "usage": AccountResponseUsage.from_dict(obj["usage"]) if obj.get("usage") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account_id": "(str,)", + "email_address": "(str,)", + "is_locked": "(bool,)", + "is_paid_hs": "(bool,)", + "is_paid_hf": "(bool,)", + "quotas": "(AccountResponseQuotas,)", + "callback_url": "(str,)", + "role_code": "(str,)", + "team_id": "(str,)", + "locale": "(str,)", + "usage": "(AccountResponseUsage,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/account_response_quotas.py b/dropbox_sign/models/account_response_quotas.py new file mode 100644 index 0000000..b67e442 --- /dev/null +++ b/dropbox_sign/models/account_response_quotas.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountResponseQuotas(BaseModel): + """ + Details concerning remaining monthly quotas. + """ # noqa: E501 + api_signature_requests_left: Optional[StrictInt] = Field(default=None, description="API signature requests remaining.") + documents_left: Optional[StrictInt] = Field(default=None, description="Signature requests remaining.") + templates_total: Optional[StrictInt] = Field(default=None, description="Total API templates allowed.") + templates_left: Optional[StrictInt] = Field(default=None, description="API templates remaining.") + sms_verifications_left: Optional[StrictInt] = Field(default=None, description="SMS verifications remaining.") + num_fax_pages_left: Optional[StrictInt] = Field(default=None, description="Number of fax pages left") + __properties: ClassVar[List[str]] = ["api_signature_requests_left", "documents_left", "templates_total", "templates_left", "sms_verifications_left", "num_fax_pages_left"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountResponseQuotas from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountResponseQuotas from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_signature_requests_left": obj.get("api_signature_requests_left"), + "documents_left": obj.get("documents_left"), + "templates_total": obj.get("templates_total"), + "templates_left": obj.get("templates_left"), + "sms_verifications_left": obj.get("sms_verifications_left"), + "num_fax_pages_left": obj.get("num_fax_pages_left") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "api_signature_requests_left": "(int,)", + "documents_left": "(int,)", + "templates_total": "(int,)", + "templates_left": "(int,)", + "sms_verifications_left": "(int,)", + "num_fax_pages_left": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/account_response_usage.py b/dropbox_sign/models/account_response_usage.py new file mode 100644 index 0000000..72bf132 --- /dev/null +++ b/dropbox_sign/models/account_response_usage.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountResponseUsage(BaseModel): + """ + Details concerning monthly usage + """ # noqa: E501 + fax_pages_sent: Optional[StrictInt] = Field(default=None, description="Number of fax pages sent") + __properties: ClassVar[List[str]] = ["fax_pages_sent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountResponseUsage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountResponseUsage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fax_pages_sent": obj.get("fax_pages_sent") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "fax_pages_sent": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/account_update_request.py b/dropbox_sign/models/account_update_request.py new file mode 100644 index 0000000..4165071 --- /dev/null +++ b/dropbox_sign/models/account_update_request.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountUpdateRequest(BaseModel): + """ + AccountUpdateRequest + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The ID of the Account") + callback_url: Optional[StrictStr] = Field(default=None, description="The URL that Dropbox Sign should POST events to.") + locale: Optional[StrictStr] = Field(default=None, description="The locale used in this Account. Check out the list of [supported locales](/api/reference/constants/#supported-locales) to learn more about the possible values.") + __properties: ClassVar[List[str]] = ["account_id", "callback_url", "locale"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountUpdateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountUpdateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "callback_url": obj.get("callback_url"), + "locale": obj.get("locale") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account_id": "(str,)", + "callback_url": "(str,)", + "locale": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/account_verify_request.py b/dropbox_sign/models/account_verify_request.py new file mode 100644 index 0000000..5d018cd --- /dev/null +++ b/dropbox_sign/models/account_verify_request.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountVerifyRequest(BaseModel): + """ + AccountVerifyRequest + """ # noqa: E501 + email_address: StrictStr = Field(description="Email address to run the verification for.") + __properties: ClassVar[List[str]] = ["email_address"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountVerifyRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountVerifyRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/account_verify_response.py b/dropbox_sign/models/account_verify_response.py new file mode 100644 index 0000000..7c3e5cc --- /dev/null +++ b/dropbox_sign/models/account_verify_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.account_verify_response_account import AccountVerifyResponseAccount +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountVerifyResponse(BaseModel): + """ + AccountVerifyResponse + """ # noqa: E501 + account: Optional[AccountVerifyResponseAccount] = None + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["account", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountVerifyResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of account + if self.account: + _dict['account'] = self.account.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountVerifyResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account": AccountVerifyResponseAccount.from_dict(obj["account"]) if obj.get("account") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account": "(AccountVerifyResponseAccount,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/account_verify_response_account.py b/dropbox_sign/models/account_verify_response_account.py new file mode 100644 index 0000000..112abc2 --- /dev/null +++ b/dropbox_sign/models/account_verify_response_account.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class AccountVerifyResponseAccount(BaseModel): + """ + AccountVerifyResponseAccount + """ # noqa: E501 + email_address: Optional[StrictStr] = Field(default=None, description="The email address associated with the Account.") + __properties: ClassVar[List[str]] = ["email_address"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccountVerifyResponseAccount from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccountVerifyResponseAccount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/api_app_create_request.py b/dropbox_sign/models/api_app_create_request.py new file mode 100644 index 0000000..e9319cc --- /dev/null +++ b/dropbox_sign/models/api_app_create_request.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_o_auth import SubOAuth +from dropbox_sign.models.sub_options import SubOptions +from dropbox_sign.models.sub_white_labeling_options import SubWhiteLabelingOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppCreateRequest(BaseModel): + """ + ApiAppCreateRequest + """ # noqa: E501 + domains: Annotated[List[StrictStr], Field(min_length=1, max_length=2)] = Field(description="The domain names the ApiApp will be associated with.") + name: StrictStr = Field(description="The name you want to assign to the ApiApp.") + callback_url: Optional[StrictStr] = Field(default=None, description="The URL at which the ApiApp should receive event callbacks.") + custom_logo_file: Optional[Union[StrictBytes, StrictStr, io.IOBase]] = Field(default=None, description="An image file to use as a custom logo in embedded contexts. (Only applies to some API plans)") + oauth: Optional[SubOAuth] = None + options: Optional[SubOptions] = None + white_labeling_options: Optional[SubWhiteLabelingOptions] = None + __properties: ClassVar[List[str]] = ["domains", "name", "callback_url", "custom_logo_file", "oauth", "options", "white_labeling_options"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAppCreateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of oauth + if self.oauth: + _dict['oauth'] = self.oauth.to_dict() + # override the default output from pydantic by calling `to_dict()` of options + if self.options: + _dict['options'] = self.options.to_dict() + # override the default output from pydantic by calling `to_dict()` of white_labeling_options + if self.white_labeling_options: + _dict['white_labeling_options'] = self.white_labeling_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "domains": obj.get("domains"), + "name": obj.get("name"), + "callback_url": obj.get("callback_url"), + "custom_logo_file": obj.get("custom_logo_file"), + "oauth": SubOAuth.from_dict(obj["oauth"]) if obj.get("oauth") is not None else None, + "options": SubOptions.from_dict(obj["options"]) if obj.get("options") is not None else None, + "white_labeling_options": SubWhiteLabelingOptions.from_dict(obj["white_labeling_options"]) if obj.get("white_labeling_options") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "domains": "(List[str],)", + "name": "(str,)", + "callback_url": "(str,)", + "custom_logo_file": "(io.IOBase,)", + "oauth": "(SubOAuth,)", + "options": "(SubOptions,)", + "white_labeling_options": "(SubWhiteLabelingOptions,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "domains", + ] + diff --git a/dropbox_sign/models/api_app_get_response.py b/dropbox_sign/models/api_app_get_response.py new file mode 100644 index 0000000..ce0317d --- /dev/null +++ b/dropbox_sign/models/api_app_get_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.api_app_response import ApiAppResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppGetResponse(BaseModel): + """ + ApiAppGetResponse + """ # noqa: E501 + api_app: ApiAppResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["api_app", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAppGetResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of api_app + if self.api_app: + _dict['api_app'] = self.api_app.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_app": ApiAppResponse.from_dict(obj["api_app"]) if obj.get("api_app") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "api_app": "(ApiAppResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/api_app_list_response.py b/dropbox_sign/models/api_app_list_response.py new file mode 100644 index 0000000..970e69d --- /dev/null +++ b/dropbox_sign/models/api_app_list_response.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.api_app_response import ApiAppResponse +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppListResponse(BaseModel): + """ + ApiAppListResponse + """ # noqa: E501 + api_apps: List[ApiAppResponse] = Field(description="Contains information about API Apps.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["api_apps", "list_info", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAppListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in api_apps (list) + _items = [] + if self.api_apps: + for _item_api_apps in self.api_apps: + if _item_api_apps: + _items.append(_item_api_apps.to_dict()) + _dict['api_apps'] = _items + # override the default output from pydantic by calling `to_dict()` of list_info + if self.list_info: + _dict['list_info'] = self.list_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_apps": [ApiAppResponse.from_dict(_item) for _item in obj["api_apps"]] if obj.get("api_apps") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "api_apps": "(List[ApiAppResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "api_apps", + "warnings", + ] + diff --git a/dropbox_sign/models/api_app_response.py b/dropbox_sign/models/api_app_response.py new file mode 100644 index 0000000..b45d59b --- /dev/null +++ b/dropbox_sign/models/api_app_response.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.api_app_response_o_auth import ApiAppResponseOAuth +from dropbox_sign.models.api_app_response_options import ApiAppResponseOptions +from dropbox_sign.models.api_app_response_owner_account import ApiAppResponseOwnerAccount +from dropbox_sign.models.api_app_response_white_labeling_options import ApiAppResponseWhiteLabelingOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppResponse(BaseModel): + """ + Contains information about an API App. + """ # noqa: E501 + callback_url: Optional[StrictStr] = Field(default=None, description="The app's callback URL (for events)") + client_id: Optional[StrictStr] = Field(default=None, description="The app's client id") + created_at: Optional[StrictInt] = Field(default=None, description="The time that the app was created") + domains: Optional[List[StrictStr]] = Field(default=None, description="The domain name(s) associated with the app") + name: Optional[StrictStr] = Field(default=None, description="The name of the app") + is_approved: Optional[StrictBool] = Field(default=None, description="Boolean to indicate if the app has been approved") + oauth: Optional[ApiAppResponseOAuth] = None + options: Optional[ApiAppResponseOptions] = None + owner_account: Optional[ApiAppResponseOwnerAccount] = None + white_labeling_options: Optional[ApiAppResponseWhiteLabelingOptions] = None + __properties: ClassVar[List[str]] = ["callback_url", "client_id", "created_at", "domains", "name", "is_approved", "oauth", "options", "owner_account", "white_labeling_options"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAppResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of oauth + if self.oauth: + _dict['oauth'] = self.oauth.to_dict() + # override the default output from pydantic by calling `to_dict()` of options + if self.options: + _dict['options'] = self.options.to_dict() + # override the default output from pydantic by calling `to_dict()` of owner_account + if self.owner_account: + _dict['owner_account'] = self.owner_account.to_dict() + # override the default output from pydantic by calling `to_dict()` of white_labeling_options + if self.white_labeling_options: + _dict['white_labeling_options'] = self.white_labeling_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callback_url": obj.get("callback_url"), + "client_id": obj.get("client_id"), + "created_at": obj.get("created_at"), + "domains": obj.get("domains"), + "name": obj.get("name"), + "is_approved": obj.get("is_approved"), + "oauth": ApiAppResponseOAuth.from_dict(obj["oauth"]) if obj.get("oauth") is not None else None, + "options": ApiAppResponseOptions.from_dict(obj["options"]) if obj.get("options") is not None else None, + "owner_account": ApiAppResponseOwnerAccount.from_dict(obj["owner_account"]) if obj.get("owner_account") is not None else None, + "white_labeling_options": ApiAppResponseWhiteLabelingOptions.from_dict(obj["white_labeling_options"]) if obj.get("white_labeling_options") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "callback_url": "(str,)", + "client_id": "(str,)", + "created_at": "(int,)", + "domains": "(List[str],)", + "name": "(str,)", + "is_approved": "(bool,)", + "oauth": "(ApiAppResponseOAuth,)", + "options": "(ApiAppResponseOptions,)", + "owner_account": "(ApiAppResponseOwnerAccount,)", + "white_labeling_options": "(ApiAppResponseWhiteLabelingOptions,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "domains", + ] + diff --git a/dropbox_sign/models/api_app_response_o_auth.py b/dropbox_sign/models/api_app_response_o_auth.py new file mode 100644 index 0000000..554bb05 --- /dev/null +++ b/dropbox_sign/models/api_app_response_o_auth.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppResponseOAuth(BaseModel): + """ + An object describing the app's OAuth properties, or null if OAuth is not configured for the app. + """ # noqa: E501 + callback_url: Optional[StrictStr] = Field(default=None, description="The app's OAuth callback URL.") + secret: Optional[StrictStr] = Field(default=None, description="The app's OAuth secret, or null if the app does not belong to user.") + scopes: Optional[List[StrictStr]] = Field(default=None, description="Array of OAuth scopes used by the app.") + charges_users: Optional[StrictBool] = Field(default=None, description="Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests.") + __properties: ClassVar[List[str]] = ["callback_url", "secret", "scopes", "charges_users"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAppResponseOAuth from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppResponseOAuth from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callback_url": obj.get("callback_url"), + "secret": obj.get("secret"), + "scopes": obj.get("scopes"), + "charges_users": obj.get("charges_users") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "callback_url": "(str,)", + "secret": "(str,)", + "scopes": "(List[str],)", + "charges_users": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "scopes", + ] + diff --git a/dropbox_sign/models/api_app_response_options.py b/dropbox_sign/models/api_app_response_options.py new file mode 100644 index 0000000..effa7a1 --- /dev/null +++ b/dropbox_sign/models/api_app_response_options.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppResponseOptions(BaseModel): + """ + An object with options that override account settings. + """ # noqa: E501 + can_insert_everywhere: Optional[StrictBool] = Field(default=None, description="Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document") + __properties: ClassVar[List[str]] = ["can_insert_everywhere"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAppResponseOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppResponseOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "can_insert_everywhere": obj.get("can_insert_everywhere") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "can_insert_everywhere": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/api_app_response_owner_account.py b/dropbox_sign/models/api_app_response_owner_account.py new file mode 100644 index 0000000..325b6f7 --- /dev/null +++ b/dropbox_sign/models/api_app_response_owner_account.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppResponseOwnerAccount(BaseModel): + """ + An object describing the app's owner + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The owner account's ID") + email_address: Optional[StrictStr] = Field(default=None, description="The owner account's email address") + __properties: ClassVar[List[str]] = ["account_id", "email_address"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAppResponseOwnerAccount from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppResponseOwnerAccount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account_id": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/api_app_response_white_labeling_options.py b/dropbox_sign/models/api_app_response_white_labeling_options.py new file mode 100644 index 0000000..7934751 --- /dev/null +++ b/dropbox_sign/models/api_app_response_white_labeling_options.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppResponseWhiteLabelingOptions(BaseModel): + """ + An object with options to customize the app's signer page + """ # noqa: E501 + header_background_color: Optional[StrictStr] = None + legal_version: Optional[StrictStr] = None + link_color: Optional[StrictStr] = None + page_background_color: Optional[StrictStr] = None + primary_button_color: Optional[StrictStr] = None + primary_button_color_hover: Optional[StrictStr] = None + primary_button_text_color: Optional[StrictStr] = None + primary_button_text_color_hover: Optional[StrictStr] = None + secondary_button_color: Optional[StrictStr] = None + secondary_button_color_hover: Optional[StrictStr] = None + secondary_button_text_color: Optional[StrictStr] = None + secondary_button_text_color_hover: Optional[StrictStr] = None + text_color1: Optional[StrictStr] = None + text_color2: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["header_background_color", "legal_version", "link_color", "page_background_color", "primary_button_color", "primary_button_color_hover", "primary_button_text_color", "primary_button_text_color_hover", "secondary_button_color", "secondary_button_color_hover", "secondary_button_text_color", "secondary_button_text_color_hover", "text_color1", "text_color2"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAppResponseWhiteLabelingOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppResponseWhiteLabelingOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "header_background_color": obj.get("header_background_color"), + "legal_version": obj.get("legal_version"), + "link_color": obj.get("link_color"), + "page_background_color": obj.get("page_background_color"), + "primary_button_color": obj.get("primary_button_color"), + "primary_button_color_hover": obj.get("primary_button_color_hover"), + "primary_button_text_color": obj.get("primary_button_text_color"), + "primary_button_text_color_hover": obj.get("primary_button_text_color_hover"), + "secondary_button_color": obj.get("secondary_button_color"), + "secondary_button_color_hover": obj.get("secondary_button_color_hover"), + "secondary_button_text_color": obj.get("secondary_button_text_color"), + "secondary_button_text_color_hover": obj.get("secondary_button_text_color_hover"), + "text_color1": obj.get("text_color1"), + "text_color2": obj.get("text_color2") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "header_background_color": "(str,)", + "legal_version": "(str,)", + "link_color": "(str,)", + "page_background_color": "(str,)", + "primary_button_color": "(str,)", + "primary_button_color_hover": "(str,)", + "primary_button_text_color": "(str,)", + "primary_button_text_color_hover": "(str,)", + "secondary_button_color": "(str,)", + "secondary_button_color_hover": "(str,)", + "secondary_button_text_color": "(str,)", + "secondary_button_text_color_hover": "(str,)", + "text_color1": "(str,)", + "text_color2": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/api_app_update_request.py b/dropbox_sign/models/api_app_update_request.py new file mode 100644 index 0000000..649ad36 --- /dev/null +++ b/dropbox_sign/models/api_app_update_request.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_o_auth import SubOAuth +from dropbox_sign.models.sub_options import SubOptions +from dropbox_sign.models.sub_white_labeling_options import SubWhiteLabelingOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ApiAppUpdateRequest(BaseModel): + """ + ApiAppUpdateRequest + """ # noqa: E501 + callback_url: Optional[StrictStr] = Field(default=None, description="The URL at which the API App should receive event callbacks.") + custom_logo_file: Optional[Union[StrictBytes, StrictStr, io.IOBase]] = Field(default=None, description="An image file to use as a custom logo in embedded contexts. (Only applies to some API plans)") + domains: Optional[Annotated[List[StrictStr], Field(max_length=2)]] = Field(default=None, description="The domain names the ApiApp will be associated with.") + name: Optional[StrictStr] = Field(default=None, description="The name you want to assign to the ApiApp.") + oauth: Optional[SubOAuth] = None + options: Optional[SubOptions] = None + white_labeling_options: Optional[SubWhiteLabelingOptions] = None + __properties: ClassVar[List[str]] = ["callback_url", "custom_logo_file", "domains", "name", "oauth", "options", "white_labeling_options"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAppUpdateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of oauth + if self.oauth: + _dict['oauth'] = self.oauth.to_dict() + # override the default output from pydantic by calling `to_dict()` of options + if self.options: + _dict['options'] = self.options.to_dict() + # override the default output from pydantic by calling `to_dict()` of white_labeling_options + if self.white_labeling_options: + _dict['white_labeling_options'] = self.white_labeling_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAppUpdateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callback_url": obj.get("callback_url"), + "custom_logo_file": obj.get("custom_logo_file"), + "domains": obj.get("domains"), + "name": obj.get("name"), + "oauth": SubOAuth.from_dict(obj["oauth"]) if obj.get("oauth") is not None else None, + "options": SubOptions.from_dict(obj["options"]) if obj.get("options") is not None else None, + "white_labeling_options": SubWhiteLabelingOptions.from_dict(obj["white_labeling_options"]) if obj.get("white_labeling_options") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "callback_url": "(str,)", + "custom_logo_file": "(io.IOBase,)", + "domains": "(List[str],)", + "name": "(str,)", + "oauth": "(SubOAuth,)", + "options": "(SubOptions,)", + "white_labeling_options": "(SubWhiteLabelingOptions,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "domains", + ] + diff --git a/dropbox_sign/models/bulk_send_job_get_response.py b/dropbox_sign/models/bulk_send_job_get_response.py new file mode 100644 index 0000000..8811323 --- /dev/null +++ b/dropbox_sign/models/bulk_send_job_get_response.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.bulk_send_job_get_response_signature_requests import BulkSendJobGetResponseSignatureRequests +from dropbox_sign.models.bulk_send_job_response import BulkSendJobResponse +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class BulkSendJobGetResponse(BaseModel): + """ + BulkSendJobGetResponse + """ # noqa: E501 + bulk_send_job: BulkSendJobResponse + list_info: ListInfoResponse + signature_requests: List[BulkSendJobGetResponseSignatureRequests] = Field(description="Contains information about the Signature Requests sent in bulk.") + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["bulk_send_job", "list_info", "signature_requests", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BulkSendJobGetResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of bulk_send_job + if self.bulk_send_job: + _dict['bulk_send_job'] = self.bulk_send_job.to_dict() + # override the default output from pydantic by calling `to_dict()` of list_info + if self.list_info: + _dict['list_info'] = self.list_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in signature_requests (list) + _items = [] + if self.signature_requests: + for _item_signature_requests in self.signature_requests: + if _item_signature_requests: + _items.append(_item_signature_requests.to_dict()) + _dict['signature_requests'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BulkSendJobGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bulk_send_job": BulkSendJobResponse.from_dict(obj["bulk_send_job"]) if obj.get("bulk_send_job") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") is not None else None, + "signature_requests": [BulkSendJobGetResponseSignatureRequests.from_dict(_item) for _item in obj["signature_requests"]] if obj.get("signature_requests") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "bulk_send_job": "(BulkSendJobResponse,)", + "list_info": "(ListInfoResponse,)", + "signature_requests": "(List[BulkSendJobGetResponseSignatureRequests],)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "signature_requests", + "warnings", + ] + diff --git a/dropbox_sign/models/bulk_send_job_get_response_signature_requests.py b/dropbox_sign/models/bulk_send_job_get_response_signature_requests.py new file mode 100644 index 0000000..71bdd81 --- /dev/null +++ b/dropbox_sign/models/bulk_send_job_get_response_signature_requests.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_attachment import SignatureRequestResponseAttachment +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from dropbox_sign.models.signature_request_response_signatures import SignatureRequestResponseSignatures +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class BulkSendJobGetResponseSignatureRequests(BaseModel): + """ + BulkSendJobGetResponseSignatureRequests + """ # noqa: E501 + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.") + signature_request_id: Optional[StrictStr] = Field(default=None, description="The id of the SignatureRequest.") + requester_email_address: Optional[StrictStr] = Field(default=None, description="The email address of the initiator of the SignatureRequest.") + title: Optional[StrictStr] = Field(default=None, description="The title the specified Account uses for the SignatureRequest.") + original_title: Optional[StrictStr] = Field(default=None, description="Default Label for account.") + subject: Optional[StrictStr] = Field(default=None, description="The subject in the email that was initially sent to the signers.") + message: Optional[StrictStr] = Field(default=None, description="The custom message in the email that was initially sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata attached to the signature request.") + created_at: Optional[StrictInt] = Field(default=None, description="Time the signature request was created.") + expires_at: Optional[StrictInt] = Field(default=None, description="The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") + is_complete: Optional[StrictBool] = Field(default=None, description="Whether or not the SignatureRequest has been fully executed by all signers.") + is_declined: Optional[StrictBool] = Field(default=None, description="Whether or not the SignatureRequest has been declined by a signer.") + has_error: Optional[StrictBool] = Field(default=None, description="Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).") + files_url: Optional[StrictStr] = Field(default=None, description="The URL where a copy of the request's documents can be downloaded.") + signing_url: Optional[StrictStr] = Field(default=None, description="The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.") + details_url: Optional[StrictStr] = Field(default=None, description="The URL where the requester and the signers can view the current status of the SignatureRequest.") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want the signer redirected to after they successfully sign.") + final_copy_uri: Optional[StrictStr] = Field(default=None, description="The path where the completed document can be downloaded") + template_ids: Optional[List[StrictStr]] = Field(default=None, description="Templates IDs used in this SignatureRequest (if any).") + custom_fields: Optional[List[SignatureRequestResponseCustomFieldBase]] = Field(default=None, description="An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") + attachments: Optional[List[SignatureRequestResponseAttachment]] = Field(default=None, description="Signer attachments.") + response_data: Optional[List[SignatureRequestResponseDataBase]] = Field(default=None, description="An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") + signatures: Optional[List[SignatureRequestResponseSignatures]] = Field(default=None, description="An array of signature objects, 1 for each signer.") + bulk_send_job_id: Optional[StrictStr] = Field(default=None, description="The id of the BulkSendJob.") + __properties: ClassVar[List[str]] = ["test_mode", "signature_request_id", "requester_email_address", "title", "original_title", "subject", "message", "metadata", "created_at", "expires_at", "is_complete", "is_declined", "has_error", "files_url", "signing_url", "details_url", "cc_email_addresses", "signing_redirect_url", "final_copy_uri", "template_ids", "custom_fields", "attachments", "response_data", "signatures", "bulk_send_job_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BulkSendJobGetResponseSignatureRequests from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in response_data (list) + _items = [] + if self.response_data: + for _item_response_data in self.response_data: + if _item_response_data: + _items.append(_item_response_data.to_dict()) + _dict['response_data'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signatures (list) + _items = [] + if self.signatures: + for _item_signatures in self.signatures: + if _item_signatures: + _items.append(_item_signatures.to_dict()) + _dict['signatures'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BulkSendJobGetResponseSignatureRequests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "signature_request_id": obj.get("signature_request_id"), + "requester_email_address": obj.get("requester_email_address"), + "title": obj.get("title"), + "original_title": obj.get("original_title"), + "subject": obj.get("subject"), + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "created_at": obj.get("created_at"), + "expires_at": obj.get("expires_at"), + "is_complete": obj.get("is_complete"), + "is_declined": obj.get("is_declined"), + "has_error": obj.get("has_error"), + "files_url": obj.get("files_url"), + "signing_url": obj.get("signing_url"), + "details_url": obj.get("details_url"), + "cc_email_addresses": obj.get("cc_email_addresses"), + "signing_redirect_url": obj.get("signing_redirect_url"), + "final_copy_uri": obj.get("final_copy_uri"), + "template_ids": obj.get("template_ids"), + "custom_fields": [SignatureRequestResponseCustomFieldBase.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "attachments": [SignatureRequestResponseAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "response_data": [SignatureRequestResponseDataBase.from_dict(_item) for _item in obj["response_data"]] if obj.get("response_data") is not None else None, + "signatures": [SignatureRequestResponseSignatures.from_dict(_item) for _item in obj["signatures"]] if obj.get("signatures") is not None else None, + "bulk_send_job_id": obj.get("bulk_send_job_id") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "test_mode": "(bool,)", + "signature_request_id": "(str,)", + "requester_email_address": "(str,)", + "title": "(str,)", + "original_title": "(str,)", + "subject": "(str,)", + "message": "(str,)", + "metadata": "(object,)", + "created_at": "(int,)", + "expires_at": "(int,)", + "is_complete": "(bool,)", + "is_declined": "(bool,)", + "has_error": "(bool,)", + "files_url": "(str,)", + "signing_url": "(str,)", + "details_url": "(str,)", + "cc_email_addresses": "(List[str],)", + "signing_redirect_url": "(str,)", + "final_copy_uri": "(str,)", + "template_ids": "(List[str],)", + "custom_fields": "(List[SignatureRequestResponseCustomFieldBase],)", + "attachments": "(List[SignatureRequestResponseAttachment],)", + "response_data": "(List[SignatureRequestResponseDataBase],)", + "signatures": "(List[SignatureRequestResponseSignatures],)", + "bulk_send_job_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "cc_email_addresses", + "template_ids", + "custom_fields", + "attachments", + "response_data", + "signatures", + ] + diff --git a/dropbox_sign/models/bulk_send_job_list_response.py b/dropbox_sign/models/bulk_send_job_list_response.py new file mode 100644 index 0000000..05ae519 --- /dev/null +++ b/dropbox_sign/models/bulk_send_job_list_response.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.bulk_send_job_response import BulkSendJobResponse +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class BulkSendJobListResponse(BaseModel): + """ + BulkSendJobListResponse + """ # noqa: E501 + bulk_send_jobs: List[BulkSendJobResponse] = Field(description="Contains a list of BulkSendJobs that the API caller has access to.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["bulk_send_jobs", "list_info", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BulkSendJobListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in bulk_send_jobs (list) + _items = [] + if self.bulk_send_jobs: + for _item_bulk_send_jobs in self.bulk_send_jobs: + if _item_bulk_send_jobs: + _items.append(_item_bulk_send_jobs.to_dict()) + _dict['bulk_send_jobs'] = _items + # override the default output from pydantic by calling `to_dict()` of list_info + if self.list_info: + _dict['list_info'] = self.list_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BulkSendJobListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bulk_send_jobs": [BulkSendJobResponse.from_dict(_item) for _item in obj["bulk_send_jobs"]] if obj.get("bulk_send_jobs") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "bulk_send_jobs": "(List[BulkSendJobResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "bulk_send_jobs", + "warnings", + ] + diff --git a/dropbox_sign/models/bulk_send_job_response.py b/dropbox_sign/models/bulk_send_job_response.py new file mode 100644 index 0000000..164d399 --- /dev/null +++ b/dropbox_sign/models/bulk_send_job_response.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class BulkSendJobResponse(BaseModel): + """ + Contains information about the BulkSendJob such as when it was created and how many signature requests are queued. + """ # noqa: E501 + bulk_send_job_id: Optional[StrictStr] = Field(default=None, description="The id of the BulkSendJob.") + total: Optional[StrictInt] = Field(default=None, description="The total amount of Signature Requests queued for sending.") + is_creator: Optional[StrictBool] = Field(default=None, description="True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member.") + created_at: Optional[StrictInt] = Field(default=None, description="Time that the BulkSendJob was created.") + __properties: ClassVar[List[str]] = ["bulk_send_job_id", "total", "is_creator", "created_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BulkSendJobResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BulkSendJobResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bulk_send_job_id": obj.get("bulk_send_job_id"), + "total": obj.get("total"), + "is_creator": obj.get("is_creator"), + "created_at": obj.get("created_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "bulk_send_job_id": "(str,)", + "total": "(int,)", + "is_creator": "(bool,)", + "created_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/bulk_send_job_send_response.py b/dropbox_sign/models/bulk_send_job_send_response.py new file mode 100644 index 0000000..932b096 --- /dev/null +++ b/dropbox_sign/models/bulk_send_job_send_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.bulk_send_job_response import BulkSendJobResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class BulkSendJobSendResponse(BaseModel): + """ + BulkSendJobSendResponse + """ # noqa: E501 + bulk_send_job: BulkSendJobResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["bulk_send_job", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BulkSendJobSendResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of bulk_send_job + if self.bulk_send_job: + _dict['bulk_send_job'] = self.bulk_send_job.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BulkSendJobSendResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bulk_send_job": BulkSendJobResponse.from_dict(obj["bulk_send_job"]) if obj.get("bulk_send_job") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "bulk_send_job": "(BulkSendJobResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/embedded_edit_url_request.py b/dropbox_sign/models/embedded_edit_url_request.py new file mode 100644 index 0000000..4eadf9c --- /dev/null +++ b/dropbox_sign/models/embedded_edit_url_request.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_merge_field import SubMergeField +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class EmbeddedEditUrlRequest(BaseModel): + """ + EmbeddedEditUrlRequest + """ # noqa: E501 + allow_edit_ccs: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable/disable to add or change CC roles when editing the template.") + cc_roles: Optional[List[StrictStr]] = Field(default=None, description="The CC roles that must be assigned when using the template to send a signature request. To remove all CC roles, pass in a single role with no name. For use in a POST request.") + editor_options: Optional[SubEditorOptions] = None + force_signer_roles: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template signer roles.") + force_subject_message: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template subject and message.") + merge_fields: Optional[List[SubMergeField]] = Field(default=None, description="Add additional merge fields to the template, which can be used used to pre-fill data by passing values into signature requests made with that template. Remove all merge fields on the template by passing an empty array `[]`.") + preview_only: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). **NOTE:** This parameter overwrites `show_preview=true` (if set).") + show_preview: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable the editor/preview experience.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`.") + __properties: ClassVar[List[str]] = ["allow_edit_ccs", "cc_roles", "editor_options", "force_signer_roles", "force_subject_message", "merge_fields", "preview_only", "show_preview", "show_progress_stepper", "test_mode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EmbeddedEditUrlRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of editor_options + if self.editor_options: + _dict['editor_options'] = self.editor_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in merge_fields (list) + _items = [] + if self.merge_fields: + for _item_merge_fields in self.merge_fields: + if _item_merge_fields: + _items.append(_item_merge_fields.to_dict()) + _dict['merge_fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EmbeddedEditUrlRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow_edit_ccs": obj.get("allow_edit_ccs") if obj.get("allow_edit_ccs") is not None else False, + "cc_roles": obj.get("cc_roles"), + "editor_options": SubEditorOptions.from_dict(obj["editor_options"]) if obj.get("editor_options") is not None else None, + "force_signer_roles": obj.get("force_signer_roles") if obj.get("force_signer_roles") is not None else False, + "force_subject_message": obj.get("force_subject_message") if obj.get("force_subject_message") is not None else False, + "merge_fields": [SubMergeField.from_dict(_item) for _item in obj["merge_fields"]] if obj.get("merge_fields") is not None else None, + "preview_only": obj.get("preview_only") if obj.get("preview_only") is not None else False, + "show_preview": obj.get("show_preview") if obj.get("show_preview") is not None else False, + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "allow_edit_ccs": "(bool,)", + "cc_roles": "(List[str],)", + "editor_options": "(SubEditorOptions,)", + "force_signer_roles": "(bool,)", + "force_subject_message": "(bool,)", + "merge_fields": "(List[SubMergeField],)", + "preview_only": "(bool,)", + "show_preview": "(bool,)", + "show_progress_stepper": "(bool,)", + "test_mode": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "cc_roles", + "merge_fields", + ] + diff --git a/dropbox_sign/models/embedded_edit_url_response.py b/dropbox_sign/models/embedded_edit_url_response.py new file mode 100644 index 0000000..e77e06f --- /dev/null +++ b/dropbox_sign/models/embedded_edit_url_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.embedded_edit_url_response_embedded import EmbeddedEditUrlResponseEmbedded +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class EmbeddedEditUrlResponse(BaseModel): + """ + EmbeddedEditUrlResponse + """ # noqa: E501 + embedded: EmbeddedEditUrlResponseEmbedded + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["embedded", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EmbeddedEditUrlResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of embedded + if self.embedded: + _dict['embedded'] = self.embedded.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EmbeddedEditUrlResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "embedded": EmbeddedEditUrlResponseEmbedded.from_dict(obj["embedded"]) if obj.get("embedded") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "embedded": "(EmbeddedEditUrlResponseEmbedded,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/embedded_edit_url_response_embedded.py b/dropbox_sign/models/embedded_edit_url_response_embedded.py new file mode 100644 index 0000000..74e23aa --- /dev/null +++ b/dropbox_sign/models/embedded_edit_url_response_embedded.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class EmbeddedEditUrlResponseEmbedded(BaseModel): + """ + An embedded template object. + """ # noqa: E501 + edit_url: Optional[StrictStr] = Field(default=None, description="A template url that can be opened in an iFrame.") + expires_at: Optional[StrictInt] = Field(default=None, description="The specific time that the the `edit_url` link expires, in epoch.") + __properties: ClassVar[List[str]] = ["edit_url", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EmbeddedEditUrlResponseEmbedded from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EmbeddedEditUrlResponseEmbedded from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "edit_url": obj.get("edit_url"), + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "edit_url": "(str,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/embedded_sign_url_response.py b/dropbox_sign/models/embedded_sign_url_response.py new file mode 100644 index 0000000..db473f2 --- /dev/null +++ b/dropbox_sign/models/embedded_sign_url_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.embedded_sign_url_response_embedded import EmbeddedSignUrlResponseEmbedded +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class EmbeddedSignUrlResponse(BaseModel): + """ + EmbeddedSignUrlResponse + """ # noqa: E501 + embedded: EmbeddedSignUrlResponseEmbedded + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["embedded", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EmbeddedSignUrlResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of embedded + if self.embedded: + _dict['embedded'] = self.embedded.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EmbeddedSignUrlResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "embedded": EmbeddedSignUrlResponseEmbedded.from_dict(obj["embedded"]) if obj.get("embedded") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "embedded": "(EmbeddedSignUrlResponseEmbedded,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/embedded_sign_url_response_embedded.py b/dropbox_sign/models/embedded_sign_url_response_embedded.py new file mode 100644 index 0000000..fd3eeba --- /dev/null +++ b/dropbox_sign/models/embedded_sign_url_response_embedded.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class EmbeddedSignUrlResponseEmbedded(BaseModel): + """ + An object that contains necessary information to set up embedded signing. + """ # noqa: E501 + sign_url: Optional[StrictStr] = Field(default=None, description="A signature url that can be opened in an iFrame.") + expires_at: Optional[StrictInt] = Field(default=None, description="The specific time that the the `sign_url` link expires, in epoch.") + __properties: ClassVar[List[str]] = ["sign_url", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EmbeddedSignUrlResponseEmbedded from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EmbeddedSignUrlResponseEmbedded from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sign_url": obj.get("sign_url"), + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "sign_url": "(str,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/error_response.py b/dropbox_sign/models/error_response.py new file mode 100644 index 0000000..adfda3e --- /dev/null +++ b/dropbox_sign/models/error_response.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.error_response_error import ErrorResponseError +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ErrorResponse(BaseModel): + """ + ErrorResponse + """ # noqa: E501 + error: ErrorResponseError + __properties: ClassVar[List[str]] = ["error"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of error + if self.error: + _dict['error'] = self.error.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": ErrorResponseError.from_dict(obj["error"]) if obj.get("error") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "error": "(ErrorResponseError,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/error_response_error.py b/dropbox_sign/models/error_response_error.py new file mode 100644 index 0000000..d5bf7fc --- /dev/null +++ b/dropbox_sign/models/error_response_error.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ErrorResponseError(BaseModel): + """ + Contains information about an error that occurred. + """ # noqa: E501 + error_msg: StrictStr = Field(description="Message describing an error.") + error_name: StrictStr = Field(description="Name of the error.") + error_path: Optional[StrictStr] = Field(default=None, description="Path at which an error occurred.") + __properties: ClassVar[List[str]] = ["error_msg", "error_name", "error_path"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorResponseError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorResponseError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error_msg": obj.get("error_msg"), + "error_name": obj.get("error_name"), + "error_path": obj.get("error_path") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "error_msg": "(str,)", + "error_name": "(str,)", + "error_path": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/event_callback_request.py b/dropbox_sign/models/event_callback_request.py new file mode 100644 index 0000000..ad851fb --- /dev/null +++ b/dropbox_sign/models/event_callback_request.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.account_response import AccountResponse +from dropbox_sign.models.event_callback_request_event import EventCallbackRequestEvent +from dropbox_sign.models.signature_request_response import SignatureRequestResponse +from dropbox_sign.models.template_response import TemplateResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class EventCallbackRequest(BaseModel): + """ + EventCallbackRequest + """ # noqa: E501 + event: EventCallbackRequestEvent + account: Optional[AccountResponse] = None + signature_request: Optional[SignatureRequestResponse] = None + template: Optional[TemplateResponse] = None + __properties: ClassVar[List[str]] = ["event", "account", "signature_request", "template"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventCallbackRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of event + if self.event: + _dict['event'] = self.event.to_dict() + # override the default output from pydantic by calling `to_dict()` of account + if self.account: + _dict['account'] = self.account.to_dict() + # override the default output from pydantic by calling `to_dict()` of signature_request + if self.signature_request: + _dict['signature_request'] = self.signature_request.to_dict() + # override the default output from pydantic by calling `to_dict()` of template + if self.template: + _dict['template'] = self.template.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventCallbackRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "event": EventCallbackRequestEvent.from_dict(obj["event"]) if obj.get("event") is not None else None, + "account": AccountResponse.from_dict(obj["account"]) if obj.get("account") is not None else None, + "signature_request": SignatureRequestResponse.from_dict(obj["signature_request"]) if obj.get("signature_request") is not None else None, + "template": TemplateResponse.from_dict(obj["template"]) if obj.get("template") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "event": "(EventCallbackRequestEvent,)", + "account": "(AccountResponse,)", + "signature_request": "(SignatureRequestResponse,)", + "template": "(TemplateResponse,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/event_callback_request_event.py b/dropbox_sign/models/event_callback_request_event.py new file mode 100644 index 0000000..ad57d9d --- /dev/null +++ b/dropbox_sign/models/event_callback_request_event.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.event_callback_request_event_metadata import EventCallbackRequestEventMetadata +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class EventCallbackRequestEvent(BaseModel): + """ + Basic information about the event that occurred. + """ # noqa: E501 + event_time: StrictStr = Field(description="Time the event was created (using Unix time).") + event_type: StrictStr = Field(description="Type of callback event that was triggered.") + event_hash: StrictStr = Field(description="Generated hash used to verify source of event data.") + event_metadata: Optional[EventCallbackRequestEventMetadata] = None + __properties: ClassVar[List[str]] = ["event_time", "event_type", "event_hash", "event_metadata"] + + @field_validator('event_type') + def event_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['account_confirmed', 'unknown_error', 'file_error', 'sign_url_invalid', 'signature_request_viewed', 'signature_request_signed', 'signature_request_sent', 'signature_request_all_signed', 'signature_request_email_bounce', 'signature_request_remind', 'signature_request_incomplete_qes', 'signature_request_destroyed', 'signature_request_canceled', 'signature_request_downloadable', 'signature_request_declined', 'signature_request_reassigned', 'signature_request_invalid', 'signature_request_prepared', 'signature_request_expired', 'template_created', 'template_error', 'callback_test', 'signature_request_signer_removed']): + raise ValueError("must be one of enum values ('account_confirmed', 'unknown_error', 'file_error', 'sign_url_invalid', 'signature_request_viewed', 'signature_request_signed', 'signature_request_sent', 'signature_request_all_signed', 'signature_request_email_bounce', 'signature_request_remind', 'signature_request_incomplete_qes', 'signature_request_destroyed', 'signature_request_canceled', 'signature_request_downloadable', 'signature_request_declined', 'signature_request_reassigned', 'signature_request_invalid', 'signature_request_prepared', 'signature_request_expired', 'template_created', 'template_error', 'callback_test', 'signature_request_signer_removed')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventCallbackRequestEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of event_metadata + if self.event_metadata: + _dict['event_metadata'] = self.event_metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventCallbackRequestEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "event_time": obj.get("event_time"), + "event_type": obj.get("event_type"), + "event_hash": obj.get("event_hash"), + "event_metadata": EventCallbackRequestEventMetadata.from_dict(obj["event_metadata"]) if obj.get("event_metadata") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "event_time": "(str,)", + "event_type": "(str,)", + "event_hash": "(str,)", + "event_metadata": "(EventCallbackRequestEventMetadata,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/event_callback_request_event_metadata.py b/dropbox_sign/models/event_callback_request_event_metadata.py new file mode 100644 index 0000000..79a90dc --- /dev/null +++ b/dropbox_sign/models/event_callback_request_event_metadata.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class EventCallbackRequestEventMetadata(BaseModel): + """ + Specific metadata about the event. + """ # noqa: E501 + related_signature_id: Optional[StrictStr] = Field(default=None, description="Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events.") + reported_for_account_id: Optional[StrictStr] = Field(default=None, description="Account ID the event was reported for.") + reported_for_app_id: Optional[StrictStr] = Field(default=None, description="App ID the event was reported for.") + event_message: Optional[StrictStr] = Field(default=None, description="Message about a declined or failed (due to error) signature flow.") + __properties: ClassVar[List[str]] = ["related_signature_id", "reported_for_account_id", "reported_for_app_id", "event_message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventCallbackRequestEventMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventCallbackRequestEventMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "related_signature_id": obj.get("related_signature_id"), + "reported_for_account_id": obj.get("reported_for_account_id"), + "reported_for_app_id": obj.get("reported_for_app_id"), + "event_message": obj.get("event_message") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "related_signature_id": "(str,)", + "reported_for_account_id": "(str,)", + "reported_for_app_id": "(str,)", + "event_message": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/fax_line_add_user_request.py b/dropbox_sign/models/fax_line_add_user_request.py new file mode 100644 index 0000000..9afd9ee --- /dev/null +++ b/dropbox_sign/models/fax_line_add_user_request.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FaxLineAddUserRequest(BaseModel): + """ + FaxLineAddUserRequest + """ # noqa: E501 + number: StrictStr = Field(description="The Fax Line number.") + account_id: Optional[StrictStr] = Field(default=None, description="Account ID") + email_address: Optional[StrictStr] = Field(default=None, description="Email address") + __properties: ClassVar[List[str]] = ["number", "account_id", "email_address"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FaxLineAddUserRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxLineAddUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "number": obj.get("number"), + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "number": "(str,)", + "account_id": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/fax_line_area_code_get_country_enum.py b/dropbox_sign/models/fax_line_area_code_get_country_enum.py new file mode 100644 index 0000000..f76331e --- /dev/null +++ b/dropbox_sign/models/fax_line_area_code_get_country_enum.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FaxLineAreaCodeGetCountryEnum(str, Enum): + """ + FaxLineAreaCodeGetCountryEnum + """ + + """ + allowed enum values + """ + CA = 'CA' + US = 'US' + UK = 'UK' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaxLineAreaCodeGetCountryEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dropbox_sign/models/fax_line_area_code_get_province_enum.py b/dropbox_sign/models/fax_line_area_code_get_province_enum.py new file mode 100644 index 0000000..cb6625d --- /dev/null +++ b/dropbox_sign/models/fax_line_area_code_get_province_enum.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FaxLineAreaCodeGetProvinceEnum(str, Enum): + """ + FaxLineAreaCodeGetProvinceEnum + """ + + """ + allowed enum values + """ + AB = 'AB' + BC = 'BC' + MB = 'MB' + NB = 'NB' + NL = 'NL' + NT = 'NT' + NS = 'NS' + NU = 'NU' + ON = 'ON' + PE = 'PE' + QC = 'QC' + SK = 'SK' + YT = 'YT' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaxLineAreaCodeGetProvinceEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dropbox_sign/models/fax_line_area_code_get_response.py b/dropbox_sign/models/fax_line_area_code_get_response.py new file mode 100644 index 0000000..ca071fa --- /dev/null +++ b/dropbox_sign/models/fax_line_area_code_get_response.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FaxLineAreaCodeGetResponse(BaseModel): + """ + FaxLineAreaCodeGetResponse + """ # noqa: E501 + area_codes: List[StrictInt] + __properties: ClassVar[List[str]] = ["area_codes"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FaxLineAreaCodeGetResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxLineAreaCodeGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "area_codes": obj.get("area_codes") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "area_codes": "(List[int],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "area_codes", + ] + diff --git a/dropbox_sign/models/fax_line_area_code_get_state_enum.py b/dropbox_sign/models/fax_line_area_code_get_state_enum.py new file mode 100644 index 0000000..29b8f70 --- /dev/null +++ b/dropbox_sign/models/fax_line_area_code_get_state_enum.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FaxLineAreaCodeGetStateEnum(str, Enum): + """ + FaxLineAreaCodeGetStateEnum + """ + + """ + allowed enum values + """ + AK = 'AK' + AL = 'AL' + AR = 'AR' + AZ = 'AZ' + CA = 'CA' + CO = 'CO' + CT = 'CT' + DC = 'DC' + DE = 'DE' + FL = 'FL' + GA = 'GA' + HI = 'HI' + IA = 'IA' + ID = 'ID' + IL = 'IL' + IN = 'IN' + KS = 'KS' + KY = 'KY' + LA = 'LA' + MA = 'MA' + MD = 'MD' + ME = 'ME' + MI = 'MI' + MN = 'MN' + MO = 'MO' + MS = 'MS' + MT = 'MT' + NC = 'NC' + ND = 'ND' + NE = 'NE' + NH = 'NH' + NJ = 'NJ' + NM = 'NM' + NV = 'NV' + NY = 'NY' + OH = 'OH' + OK = 'OK' + OR = 'OR' + PA = 'PA' + RI = 'RI' + SC = 'SC' + SD = 'SD' + TN = 'TN' + TX = 'TX' + UT = 'UT' + VA = 'VA' + VT = 'VT' + WA = 'WA' + WI = 'WI' + WV = 'WV' + WY = 'WY' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FaxLineAreaCodeGetStateEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dropbox_sign/models/fax_line_create_request.py b/dropbox_sign/models/fax_line_create_request.py new file mode 100644 index 0000000..aa27a9b --- /dev/null +++ b/dropbox_sign/models/fax_line_create_request.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FaxLineCreateRequest(BaseModel): + """ + FaxLineCreateRequest + """ # noqa: E501 + area_code: StrictInt = Field(description="Area code") + country: StrictStr = Field(description="Country") + city: Optional[StrictStr] = Field(default=None, description="City") + account_id: Optional[StrictStr] = Field(default=None, description="Account ID") + __properties: ClassVar[List[str]] = ["area_code", "country", "city", "account_id"] + + @field_validator('country') + def country_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CA', 'US', 'UK']): + raise ValueError("must be one of enum values ('CA', 'US', 'UK')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FaxLineCreateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxLineCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "area_code": obj.get("area_code"), + "country": obj.get("country"), + "city": obj.get("city"), + "account_id": obj.get("account_id") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "area_code": "(int,)", + "country": "(str,)", + "city": "(str,)", + "account_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/fax_line_delete_request.py b/dropbox_sign/models/fax_line_delete_request.py new file mode 100644 index 0000000..f52880d --- /dev/null +++ b/dropbox_sign/models/fax_line_delete_request.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FaxLineDeleteRequest(BaseModel): + """ + FaxLineDeleteRequest + """ # noqa: E501 + number: StrictStr = Field(description="The Fax Line number.") + __properties: ClassVar[List[str]] = ["number"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FaxLineDeleteRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxLineDeleteRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "number": obj.get("number") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "number": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/fax_line_list_response.py b/dropbox_sign/models/fax_line_list_response.py new file mode 100644 index 0000000..6f09067 --- /dev/null +++ b/dropbox_sign/models/fax_line_list_response.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.fax_line_response_fax_line import FaxLineResponseFaxLine +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FaxLineListResponse(BaseModel): + """ + FaxLineListResponse + """ # noqa: E501 + list_info: ListInfoResponse + fax_lines: List[FaxLineResponseFaxLine] + warnings: Optional[WarningResponse] = None + __properties: ClassVar[List[str]] = ["list_info", "fax_lines", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FaxLineListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of list_info + if self.list_info: + _dict['list_info'] = self.list_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in fax_lines (list) + _items = [] + if self.fax_lines: + for _item_fax_lines in self.fax_lines: + if _item_fax_lines: + _items.append(_item_fax_lines.to_dict()) + _dict['fax_lines'] = _items + # override the default output from pydantic by calling `to_dict()` of warnings + if self.warnings: + _dict['warnings'] = self.warnings.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxLineListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") is not None else None, + "fax_lines": [FaxLineResponseFaxLine.from_dict(_item) for _item in obj["fax_lines"]] if obj.get("fax_lines") is not None else None, + "warnings": WarningResponse.from_dict(obj["warnings"]) if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "list_info": "(ListInfoResponse,)", + "fax_lines": "(List[FaxLineResponseFaxLine],)", + "warnings": "(WarningResponse,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "fax_lines", + ] + diff --git a/dropbox_sign/models/fax_line_remove_user_request.py b/dropbox_sign/models/fax_line_remove_user_request.py new file mode 100644 index 0000000..e4c1004 --- /dev/null +++ b/dropbox_sign/models/fax_line_remove_user_request.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FaxLineRemoveUserRequest(BaseModel): + """ + FaxLineRemoveUserRequest + """ # noqa: E501 + number: StrictStr = Field(description="The Fax Line number.") + account_id: Optional[StrictStr] = Field(default=None, description="Account ID") + email_address: Optional[StrictStr] = Field(default=None, description="Email address") + __properties: ClassVar[List[str]] = ["number", "account_id", "email_address"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FaxLineRemoveUserRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxLineRemoveUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "number": obj.get("number"), + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "number": "(str,)", + "account_id": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/fax_line_response.py b/dropbox_sign/models/fax_line_response.py new file mode 100644 index 0000000..b3e1613 --- /dev/null +++ b/dropbox_sign/models/fax_line_response.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.fax_line_response_fax_line import FaxLineResponseFaxLine +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FaxLineResponse(BaseModel): + """ + FaxLineResponse + """ # noqa: E501 + fax_line: FaxLineResponseFaxLine + warnings: Optional[WarningResponse] = None + __properties: ClassVar[List[str]] = ["fax_line", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FaxLineResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of fax_line + if self.fax_line: + _dict['fax_line'] = self.fax_line.to_dict() + # override the default output from pydantic by calling `to_dict()` of warnings + if self.warnings: + _dict['warnings'] = self.warnings.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxLineResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fax_line": FaxLineResponseFaxLine.from_dict(obj["fax_line"]) if obj.get("fax_line") is not None else None, + "warnings": WarningResponse.from_dict(obj["warnings"]) if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "fax_line": "(FaxLineResponseFaxLine,)", + "warnings": "(WarningResponse,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/fax_line_response_fax_line.py b/dropbox_sign/models/fax_line_response_fax_line.py new file mode 100644 index 0000000..cedc50d --- /dev/null +++ b/dropbox_sign/models/fax_line_response_fax_line.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.account_response import AccountResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FaxLineResponseFaxLine(BaseModel): + """ + FaxLineResponseFaxLine + """ # noqa: E501 + number: Optional[StrictStr] = Field(default=None, description="Number") + created_at: Optional[StrictInt] = Field(default=None, description="Created at") + updated_at: Optional[StrictInt] = Field(default=None, description="Updated at") + accounts: Optional[List[AccountResponse]] = None + __properties: ClassVar[List[str]] = ["number", "created_at", "updated_at", "accounts"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FaxLineResponseFaxLine from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in accounts (list) + _items = [] + if self.accounts: + for _item_accounts in self.accounts: + if _item_accounts: + _items.append(_item_accounts.to_dict()) + _dict['accounts'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FaxLineResponseFaxLine from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "number": obj.get("number"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "accounts": [AccountResponse.from_dict(_item) for _item in obj["accounts"]] if obj.get("accounts") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "number": "(str,)", + "created_at": "(int,)", + "updated_at": "(int,)", + "accounts": "(List[AccountResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "accounts", + ] + diff --git a/dropbox_sign/models/file_response.py b/dropbox_sign/models/file_response.py new file mode 100644 index 0000000..8e7fe3c --- /dev/null +++ b/dropbox_sign/models/file_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FileResponse(BaseModel): + """ + FileResponse + """ # noqa: E501 + file_url: StrictStr = Field(description="URL to the file.") + expires_at: StrictInt = Field(description="When the link expires.") + __properties: ClassVar[List[str]] = ["file_url", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FileResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FileResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "file_url": obj.get("file_url"), + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "file_url": "(str,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/file_response_data_uri.py b/dropbox_sign/models/file_response_data_uri.py new file mode 100644 index 0000000..012bc83 --- /dev/null +++ b/dropbox_sign/models/file_response_data_uri.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class FileResponseDataUri(BaseModel): + """ + FileResponseDataUri + """ # noqa: E501 + data_uri: StrictStr = Field(description="File as base64 encoded string.") + __properties: ClassVar[List[str]] = ["data_uri"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FileResponseDataUri from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FileResponseDataUri from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_uri": obj.get("data_uri") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "data_uri": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/list_info_response.py b/dropbox_sign/models/list_info_response.py new file mode 100644 index 0000000..816accb --- /dev/null +++ b/dropbox_sign/models/list_info_response.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ListInfoResponse(BaseModel): + """ + Contains pagination information about the data returned. + """ # noqa: E501 + num_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages available.") + num_results: Optional[StrictInt] = Field(default=None, description="Total number of objects available.") + page: Optional[StrictInt] = Field(default=None, description="Number of the page being returned.") + page_size: Optional[StrictInt] = Field(default=None, description="Objects returned per page.") + __properties: ClassVar[List[str]] = ["num_pages", "num_results", "page", "page_size"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListInfoResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListInfoResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "num_pages": obj.get("num_pages"), + "num_results": obj.get("num_results"), + "page": obj.get("page"), + "page_size": obj.get("page_size") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "num_pages": "(int,)", + "num_results": "(int,)", + "page": "(int,)", + "page_size": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/o_auth_token_generate_request.py b/dropbox_sign/models/o_auth_token_generate_request.py new file mode 100644 index 0000000..0f2f0ae --- /dev/null +++ b/dropbox_sign/models/o_auth_token_generate_request.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class OAuthTokenGenerateRequest(BaseModel): + """ + OAuthTokenGenerateRequest + """ # noqa: E501 + client_id: StrictStr = Field(description="The client id of the app requesting authorization.") + client_secret: StrictStr = Field(description="The secret token of your app.") + code: StrictStr = Field(description="The code passed to your callback when the user granted access.") + grant_type: StrictStr = Field(description="When generating a new token use `authorization_code`.") + state: StrictStr = Field(description="Same as the state you specified earlier.") + __properties: ClassVar[List[str]] = ["client_id", "client_secret", "code", "grant_type", "state"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OAuthTokenGenerateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OAuthTokenGenerateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "client_secret": obj.get("client_secret"), + "code": obj.get("code"), + "grant_type": obj.get("grant_type") if obj.get("grant_type") is not None else 'authorization_code', + "state": obj.get("state") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "client_secret": "(str,)", + "code": "(str,)", + "grant_type": "(str,)", + "state": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/o_auth_token_refresh_request.py b/dropbox_sign/models/o_auth_token_refresh_request.py new file mode 100644 index 0000000..7b4ee8b --- /dev/null +++ b/dropbox_sign/models/o_auth_token_refresh_request.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class OAuthTokenRefreshRequest(BaseModel): + """ + OAuthTokenRefreshRequest + """ # noqa: E501 + grant_type: StrictStr = Field(description="When refreshing an existing token use `refresh_token`.") + refresh_token: StrictStr = Field(description="The token provided when you got the expired access token.") + __properties: ClassVar[List[str]] = ["grant_type", "refresh_token"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OAuthTokenRefreshRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OAuthTokenRefreshRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "grant_type": obj.get("grant_type") if obj.get("grant_type") is not None else 'refresh_token', + "refresh_token": obj.get("refresh_token") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "grant_type": "(str,)", + "refresh_token": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/o_auth_token_response.py b/dropbox_sign/models/o_auth_token_response.py new file mode 100644 index 0000000..6ababb4 --- /dev/null +++ b/dropbox_sign/models/o_auth_token_response.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class OAuthTokenResponse(BaseModel): + """ + OAuthTokenResponse + """ # noqa: E501 + access_token: Optional[StrictStr] = None + token_type: Optional[StrictStr] = None + refresh_token: Optional[StrictStr] = None + expires_in: Optional[StrictInt] = Field(default=None, description="Number of seconds until the `access_token` expires. Uses epoch time.") + state: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["access_token", "token_type", "refresh_token", "expires_in", "state"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OAuthTokenResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OAuthTokenResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "access_token": obj.get("access_token"), + "token_type": obj.get("token_type"), + "refresh_token": obj.get("refresh_token"), + "expires_in": obj.get("expires_in"), + "state": obj.get("state") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "access_token": "(str,)", + "token_type": "(str,)", + "refresh_token": "(str,)", + "expires_in": "(int,)", + "state": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/report_create_request.py b/dropbox_sign/models/report_create_request.py new file mode 100644 index 0000000..3276ff2 --- /dev/null +++ b/dropbox_sign/models/report_create_request.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ReportCreateRequest(BaseModel): + """ + ReportCreateRequest + """ # noqa: E501 + end_date: StrictStr = Field(description="The (inclusive) end date for the report data in `MM/DD/YYYY` format.") + report_type: Annotated[List[StrictStr], Field(min_length=1, max_length=2)] = Field(description="The type(s) of the report you are requesting. Allowed values are `user_activity` and `document_status`. User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).") + start_date: StrictStr = Field(description="The (inclusive) start date for the report data in `MM/DD/YYYY` format.") + __properties: ClassVar[List[str]] = ["end_date", "report_type", "start_date"] + + @field_validator('report_type') + def report_type_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['user_activity', 'document_status']): + raise ValueError("each list item must be one of ('user_activity', 'document_status')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReportCreateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReportCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "end_date": obj.get("end_date"), + "report_type": obj.get("report_type"), + "start_date": obj.get("start_date") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "end_date": "(str,)", + "report_type": "(List[str],)", + "start_date": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "report_type", + ] + diff --git a/dropbox_sign/models/report_create_response.py b/dropbox_sign/models/report_create_response.py new file mode 100644 index 0000000..99a5f33 --- /dev/null +++ b/dropbox_sign/models/report_create_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.report_response import ReportResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ReportCreateResponse(BaseModel): + """ + ReportCreateResponse + """ # noqa: E501 + report: ReportResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["report", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReportCreateResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of report + if self.report: + _dict['report'] = self.report.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReportCreateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "report": ReportResponse.from_dict(obj["report"]) if obj.get("report") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "report": "(ReportResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/report_response.py b/dropbox_sign/models/report_response.py new file mode 100644 index 0000000..b801a30 --- /dev/null +++ b/dropbox_sign/models/report_response.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class ReportResponse(BaseModel): + """ + Contains information about the report request. + """ # noqa: E501 + success: Optional[StrictStr] = Field(default=None, description="A message indicating the requested operation's success") + start_date: Optional[StrictStr] = Field(default=None, description="The (inclusive) start date for the report data in MM/DD/YYYY format.") + end_date: Optional[StrictStr] = Field(default=None, description="The (inclusive) end date for the report data in MM/DD/YYYY format.") + report_type: Optional[List[StrictStr]] = Field(default=None, description="The type(s) of the report you are requesting. Allowed values are \"user_activity\" and \"document_status\". User activity reports contain list of all users and their activity during the specified date range. Document status report contain a list of signature requests created in the specified time range (and their status).") + __properties: ClassVar[List[str]] = ["success", "start_date", "end_date", "report_type"] + + @field_validator('report_type') + def report_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['user_activity', 'document_status']): + raise ValueError("each list item must be one of ('user_activity', 'document_status')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReportResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReportResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "success": obj.get("success"), + "start_date": obj.get("start_date"), + "end_date": obj.get("end_date"), + "report_type": obj.get("report_type") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "success": "(str,)", + "start_date": "(str,)", + "end_date": "(str,)", + "report_type": "(List[str],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "report_type", + ] + diff --git a/dropbox_sign/models/signature_request_bulk_create_embedded_with_template_request.py b/dropbox_sign/models/signature_request_bulk_create_embedded_with_template_request.py new file mode 100644 index 0000000..f6be2bb --- /dev/null +++ b/dropbox_sign/models/signature_request_bulk_create_embedded_with_template_request.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_bulk_signer_list import SubBulkSignerList +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestBulkCreateEmbeddedWithTemplateRequest(BaseModel): + """ + SignatureRequestBulkCreateEmbeddedWithTemplateRequest + """ # noqa: E501 + template_ids: List[StrictStr] = Field(description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") + client_id: StrictStr = Field(description="Client id of the app you're using to create this embedded signature request. Used for security purposes.") + signer_file: Optional[Union[StrictBytes, StrictStr, io.IOBase]] = Field(default=None, description="`signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```") + signer_list: Optional[List[SubBulkSignerList]] = Field(default=None, description="`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + ccs: Optional[List[SubCC]] = Field(default=None, description="Add CC email recipients. Required when a CC role exists for the Template.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + __properties: ClassVar[List[str]] = ["template_ids", "client_id", "signer_file", "signer_list", "allow_decline", "ccs", "custom_fields", "message", "metadata", "signing_redirect_url", "subject", "test_mode", "title"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestBulkCreateEmbeddedWithTemplateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signer_list (list) + _items = [] + if self.signer_list: + for _item_signer_list in self.signer_list: + if _item_signer_list: + _items.append(_item_signer_list.to_dict()) + _dict['signer_list'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict['ccs'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestBulkCreateEmbeddedWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_ids": obj.get("template_ids"), + "client_id": obj.get("client_id"), + "signer_file": obj.get("signer_file"), + "signer_list": [SubBulkSignerList.from_dict(_item) for _item in obj["signer_list"]] if obj.get("signer_list") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "ccs": [SubCC.from_dict(_item) for _item in obj["ccs"]] if obj.get("ccs") is not None else None, + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_ids": "(List[str],)", + "client_id": "(str,)", + "signer_file": "(io.IOBase,)", + "signer_list": "(List[SubBulkSignerList],)", + "allow_decline": "(bool,)", + "ccs": "(List[SubCC],)", + "custom_fields": "(List[SubCustomField],)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "signer_list", + "ccs", + "custom_fields", + ] + diff --git a/dropbox_sign/models/signature_request_bulk_send_with_template_request.py b/dropbox_sign/models/signature_request_bulk_send_with_template_request.py new file mode 100644 index 0000000..4e4abf8 --- /dev/null +++ b/dropbox_sign/models/signature_request_bulk_send_with_template_request.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_bulk_signer_list import SubBulkSignerList +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestBulkSendWithTemplateRequest(BaseModel): + """ + SignatureRequestBulkSendWithTemplateRequest + """ # noqa: E501 + template_ids: List[StrictStr] = Field(description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") + signer_file: Optional[Union[StrictBytes, StrictStr, io.IOBase]] = Field(default=None, description="`signer_file` is a CSV file defining values and options for signer fields. Required unless a `signer_list` is used, you may not use both. The CSV can have the following columns: - `name`: the name of the signer filling the role of RoleName - `email_address`: email address of the signer filling the role of RoleName - `pin`: the 4- to 12-character access code that will secure this signer's signature page (optional) - `sms_phone_number`: An E.164 formatted phone number that will receive a code via SMS to access this signer's signature page. (optional) By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher. - `*_field`: any column with a _field\" suffix will be treated as a custom field (optional) You may only specify field values here, any other options should be set in the custom_fields request parameter. Example CSV: ``` name, email_address, pin, company_field George, george@example.com, d79a3td, ABC Corp Mary, mary@example.com, gd9as5b, 123 LLC ```") + signer_list: Optional[List[SubBulkSignerList]] = Field(default=None, description="`signer_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + ccs: Optional[List[SubCC]] = Field(default=None, description="Add CC email recipients. Required when a CC role exists for the Template.") + client_id: Optional[StrictStr] = Field(default=None, description="The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + __properties: ClassVar[List[str]] = ["template_ids", "signer_file", "signer_list", "allow_decline", "ccs", "client_id", "custom_fields", "message", "metadata", "signing_redirect_url", "subject", "test_mode", "title"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestBulkSendWithTemplateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signer_list (list) + _items = [] + if self.signer_list: + for _item_signer_list in self.signer_list: + if _item_signer_list: + _items.append(_item_signer_list.to_dict()) + _dict['signer_list'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict['ccs'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestBulkSendWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_ids": obj.get("template_ids"), + "signer_file": obj.get("signer_file"), + "signer_list": [SubBulkSignerList.from_dict(_item) for _item in obj["signer_list"]] if obj.get("signer_list") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "ccs": [SubCC.from_dict(_item) for _item in obj["ccs"]] if obj.get("ccs") is not None else None, + "client_id": obj.get("client_id"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_ids": "(List[str],)", + "signer_file": "(io.IOBase,)", + "signer_list": "(List[SubBulkSignerList],)", + "allow_decline": "(bool,)", + "ccs": "(List[SubCC],)", + "client_id": "(str,)", + "custom_fields": "(List[SubCustomField],)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "signer_list", + "ccs", + "custom_fields", + ] + diff --git a/dropbox_sign/models/signature_request_create_embedded_request.py b/dropbox_sign/models/signature_request_create_embedded_request.py new file mode 100644 index 0000000..f4474c5 --- /dev/null +++ b/dropbox_sign/models/signature_request_create_embedded_request.py @@ -0,0 +1,265 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners +from dropbox_sign.models.sub_signature_request_signer import SubSignatureRequestSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestCreateEmbeddedRequest(BaseModel): + """ + SignatureRequestCreateEmbeddedRequest + """ # noqa: E501 + client_id: StrictStr = Field(description="Client id of the app you're using to create this embedded signature request. Used for security purposes.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + signers: Optional[List[SubSignatureRequestSigner]] = Field(default=None, description="Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") + grouped_signers: Optional[List[SubSignatureRequestGroupedSigners]] = Field(default=None, description="Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="The email addresses that should be CCed.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + field_options: Optional[SubFieldOptions] = None + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field(default=None, description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + hide_text_tags: Optional[StrictBool] = Field(default=False, description="Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_options: Optional[SubSigningOptions] = None + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + use_text_tags: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.") + populate_auto_fill_fields: Optional[StrictBool] = Field(default=False, description="Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") + expires_at: Optional[StrictInt] = Field(default=None, description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") + __properties: ClassVar[List[str]] = ["client_id", "files", "file_urls", "signers", "grouped_signers", "allow_decline", "allow_reassign", "attachments", "cc_email_addresses", "custom_fields", "field_options", "form_field_groups", "form_field_rules", "form_fields_per_document", "hide_text_tags", "message", "metadata", "signing_options", "subject", "test_mode", "title", "use_text_tags", "populate_auto_fill_fields", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestCreateEmbeddedRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in grouped_signers (list) + _items = [] + if self.grouped_signers: + for _item_grouped_signers in self.grouped_signers: + if _item_grouped_signers: + _items.append(_item_grouped_signers.to_dict()) + _dict['grouped_signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestCreateEmbeddedRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "signers": [SubSignatureRequestSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "grouped_signers": [SubSignatureRequestGroupedSigners.from_dict(_item) for _item in obj["grouped_signers"]] if obj.get("grouped_signers") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_email_addresses": obj.get("cc_email_addresses"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "hide_text_tags": obj.get("hide_text_tags") if obj.get("hide_text_tags") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "use_text_tags": obj.get("use_text_tags") if obj.get("use_text_tags") is not None else False, + "populate_auto_fill_fields": obj.get("populate_auto_fill_fields") if obj.get("populate_auto_fill_fields") is not None else False, + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "signers": "(List[SubSignatureRequestSigner],)", + "grouped_signers": "(List[SubSignatureRequestGroupedSigners],)", + "allow_decline": "(bool,)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_email_addresses": "(List[str],)", + "custom_fields": "(List[SubCustomField],)", + "field_options": "(SubFieldOptions,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "hide_text_tags": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "use_text_tags": "(bool,)", + "populate_auto_fill_fields": "(bool,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "signers", + "grouped_signers", + "attachments", + "cc_email_addresses", + "custom_fields", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + ] + diff --git a/dropbox_sign/models/signature_request_create_embedded_with_template_request.py b/dropbox_sign/models/signature_request_create_embedded_with_template_request.py new file mode 100644 index 0000000..d991872 --- /dev/null +++ b/dropbox_sign/models/signature_request_create_embedded_with_template_request.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestCreateEmbeddedWithTemplateRequest(BaseModel): + """ + SignatureRequestCreateEmbeddedWithTemplateRequest + """ # noqa: E501 + template_ids: List[StrictStr] = Field(description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") + client_id: StrictStr = Field(description="Client id of the app you're using to create this embedded signature request. Used for security purposes.") + signers: List[SubSignatureRequestTemplateSigner] = Field(description="Add Signers to your Templated-based Signature Request.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + ccs: Optional[List[SubCC]] = Field(default=None, description="Add CC email recipients. Required when a CC role exists for the Template.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="An array defining values and options for custom fields. Required when a custom field exists in the Template.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_options: Optional[SubSigningOptions] = None + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + populate_auto_fill_fields: Optional[StrictBool] = Field(default=False, description="Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") + __properties: ClassVar[List[str]] = ["template_ids", "client_id", "signers", "allow_decline", "ccs", "custom_fields", "files", "file_urls", "message", "metadata", "signing_options", "subject", "test_mode", "title", "populate_auto_fill_fields"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestCreateEmbeddedWithTemplateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict['ccs'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestCreateEmbeddedWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_ids": obj.get("template_ids"), + "client_id": obj.get("client_id"), + "signers": [SubSignatureRequestTemplateSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "ccs": [SubCC.from_dict(_item) for _item in obj["ccs"]] if obj.get("ccs") is not None else None, + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "populate_auto_fill_fields": obj.get("populate_auto_fill_fields") if obj.get("populate_auto_fill_fields") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_ids": "(List[str],)", + "client_id": "(str,)", + "signers": "(List[SubSignatureRequestTemplateSigner],)", + "allow_decline": "(bool,)", + "ccs": "(List[SubCC],)", + "custom_fields": "(List[SubCustomField],)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "populate_auto_fill_fields": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "signers", + "ccs", + "custom_fields", + "files", + "file_urls", + ] + diff --git a/dropbox_sign/models/signature_request_get_response.py b/dropbox_sign/models/signature_request_get_response.py new file mode 100644 index 0000000..4a950cc --- /dev/null +++ b/dropbox_sign/models/signature_request_get_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response import SignatureRequestResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestGetResponse(BaseModel): + """ + SignatureRequestGetResponse + """ # noqa: E501 + signature_request: SignatureRequestResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["signature_request", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestGetResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of signature_request + if self.signature_request: + _dict['signature_request'] = self.signature_request.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "signature_request": SignatureRequestResponse.from_dict(obj["signature_request"]) if obj.get("signature_request") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "signature_request": "(SignatureRequestResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/signature_request_list_response.py b/dropbox_sign/models/signature_request_list_response.py new file mode 100644 index 0000000..4b9c3a6 --- /dev/null +++ b/dropbox_sign/models/signature_request_list_response.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.signature_request_response import SignatureRequestResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestListResponse(BaseModel): + """ + SignatureRequestListResponse + """ # noqa: E501 + signature_requests: List[SignatureRequestResponse] = Field(description="Contains information about signature requests.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["signature_requests", "list_info", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signature_requests (list) + _items = [] + if self.signature_requests: + for _item_signature_requests in self.signature_requests: + if _item_signature_requests: + _items.append(_item_signature_requests.to_dict()) + _dict['signature_requests'] = _items + # override the default output from pydantic by calling `to_dict()` of list_info + if self.list_info: + _dict['list_info'] = self.list_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "signature_requests": [SignatureRequestResponse.from_dict(_item) for _item in obj["signature_requests"]] if obj.get("signature_requests") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "signature_requests": "(List[SignatureRequestResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "signature_requests", + "warnings", + ] + diff --git a/dropbox_sign/models/signature_request_remind_request.py b/dropbox_sign/models/signature_request_remind_request.py new file mode 100644 index 0000000..5b7c9a2 --- /dev/null +++ b/dropbox_sign/models/signature_request_remind_request.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestRemindRequest(BaseModel): + """ + SignatureRequestRemindRequest + """ # noqa: E501 + email_address: StrictStr = Field(description="The email address of the signer to send a reminder to.") + name: Optional[StrictStr] = Field(default=None, description="The name of the signer to send a reminder to. Include if two or more signers share an email address.") + __properties: ClassVar[List[str]] = ["email_address", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestRemindRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestRemindRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address"), + "name": obj.get("name") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "email_address": "(str,)", + "name": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response.py b/dropbox_sign/models/signature_request_response.py new file mode 100644 index 0000000..08cf1cf --- /dev/null +++ b/dropbox_sign/models/signature_request_response.py @@ -0,0 +1,231 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_attachment import SignatureRequestResponseAttachment +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from dropbox_sign.models.signature_request_response_signatures import SignatureRequestResponseSignatures +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponse(BaseModel): + """ + Contains information about a signature request. + """ # noqa: E501 + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test signature request. Test requests have no legal value. Defaults to `false`.") + signature_request_id: Optional[StrictStr] = Field(default=None, description="The id of the SignatureRequest.") + requester_email_address: Optional[StrictStr] = Field(default=None, description="The email address of the initiator of the SignatureRequest.") + title: Optional[StrictStr] = Field(default=None, description="The title the specified Account uses for the SignatureRequest.") + original_title: Optional[StrictStr] = Field(default=None, description="Default Label for account.") + subject: Optional[StrictStr] = Field(default=None, description="The subject in the email that was initially sent to the signers.") + message: Optional[StrictStr] = Field(default=None, description="The custom message in the email that was initially sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata attached to the signature request.") + created_at: Optional[StrictInt] = Field(default=None, description="Time the signature request was created.") + expires_at: Optional[StrictInt] = Field(default=None, description="The time when the signature request will expire unsigned signatures. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") + is_complete: Optional[StrictBool] = Field(default=None, description="Whether or not the SignatureRequest has been fully executed by all signers.") + is_declined: Optional[StrictBool] = Field(default=None, description="Whether or not the SignatureRequest has been declined by a signer.") + has_error: Optional[StrictBool] = Field(default=None, description="Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings).") + files_url: Optional[StrictStr] = Field(default=None, description="The URL where a copy of the request's documents can be downloaded.") + signing_url: Optional[StrictStr] = Field(default=None, description="The URL where a signer, after authenticating, can sign the documents. This should only be used by users with existing Dropbox Sign accounts as they will be required to log in before signing.") + details_url: Optional[StrictStr] = Field(default=None, description="The URL where the requester and the signers can view the current status of the SignatureRequest.") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="A list of email addresses that were CCed on the SignatureRequest. They will receive a copy of the final PDF once all the signers have signed.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want the signer redirected to after they successfully sign.") + final_copy_uri: Optional[StrictStr] = Field(default=None, description="The path where the completed document can be downloaded") + template_ids: Optional[List[StrictStr]] = Field(default=None, description="Templates IDs used in this SignatureRequest (if any).") + custom_fields: Optional[List[SignatureRequestResponseCustomFieldBase]] = Field(default=None, description="An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox`") + attachments: Optional[List[SignatureRequestResponseAttachment]] = Field(default=None, description="Signer attachments.") + response_data: Optional[List[SignatureRequestResponseDataBase]] = Field(default=None, description="An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers.") + signatures: Optional[List[SignatureRequestResponseSignatures]] = Field(default=None, description="An array of signature objects, 1 for each signer.") + bulk_send_job_id: Optional[StrictStr] = Field(default=None, description="The ID of the Bulk Send job which sent the signature request, if applicable.") + __properties: ClassVar[List[str]] = ["test_mode", "signature_request_id", "requester_email_address", "title", "original_title", "subject", "message", "metadata", "created_at", "expires_at", "is_complete", "is_declined", "has_error", "files_url", "signing_url", "details_url", "cc_email_addresses", "signing_redirect_url", "final_copy_uri", "template_ids", "custom_fields", "attachments", "response_data", "signatures", "bulk_send_job_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in response_data (list) + _items = [] + if self.response_data: + for _item_response_data in self.response_data: + if _item_response_data: + _items.append(_item_response_data.to_dict()) + _dict['response_data'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signatures (list) + _items = [] + if self.signatures: + for _item_signatures in self.signatures: + if _item_signatures: + _items.append(_item_signatures.to_dict()) + _dict['signatures'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "signature_request_id": obj.get("signature_request_id"), + "requester_email_address": obj.get("requester_email_address"), + "title": obj.get("title"), + "original_title": obj.get("original_title"), + "subject": obj.get("subject"), + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "created_at": obj.get("created_at"), + "expires_at": obj.get("expires_at"), + "is_complete": obj.get("is_complete"), + "is_declined": obj.get("is_declined"), + "has_error": obj.get("has_error"), + "files_url": obj.get("files_url"), + "signing_url": obj.get("signing_url"), + "details_url": obj.get("details_url"), + "cc_email_addresses": obj.get("cc_email_addresses"), + "signing_redirect_url": obj.get("signing_redirect_url"), + "final_copy_uri": obj.get("final_copy_uri"), + "template_ids": obj.get("template_ids"), + "custom_fields": [SignatureRequestResponseCustomFieldBase.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "attachments": [SignatureRequestResponseAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "response_data": [SignatureRequestResponseDataBase.from_dict(_item) for _item in obj["response_data"]] if obj.get("response_data") is not None else None, + "signatures": [SignatureRequestResponseSignatures.from_dict(_item) for _item in obj["signatures"]] if obj.get("signatures") is not None else None, + "bulk_send_job_id": obj.get("bulk_send_job_id") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "test_mode": "(bool,)", + "signature_request_id": "(str,)", + "requester_email_address": "(str,)", + "title": "(str,)", + "original_title": "(str,)", + "subject": "(str,)", + "message": "(str,)", + "metadata": "(object,)", + "created_at": "(int,)", + "expires_at": "(int,)", + "is_complete": "(bool,)", + "is_declined": "(bool,)", + "has_error": "(bool,)", + "files_url": "(str,)", + "signing_url": "(str,)", + "details_url": "(str,)", + "cc_email_addresses": "(List[str],)", + "signing_redirect_url": "(str,)", + "final_copy_uri": "(str,)", + "template_ids": "(List[str],)", + "custom_fields": "(List[SignatureRequestResponseCustomFieldBase],)", + "attachments": "(List[SignatureRequestResponseAttachment],)", + "response_data": "(List[SignatureRequestResponseDataBase],)", + "signatures": "(List[SignatureRequestResponseSignatures],)", + "bulk_send_job_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "cc_email_addresses", + "template_ids", + "custom_fields", + "attachments", + "response_data", + "signatures", + ] + diff --git a/dropbox_sign/models/signature_request_response_attachment.py b/dropbox_sign/models/signature_request_response_attachment.py new file mode 100644 index 0000000..6c833fd --- /dev/null +++ b/dropbox_sign/models/signature_request_response_attachment.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseAttachment(BaseModel): + """ + Signer attachments. + """ # noqa: E501 + id: StrictStr = Field(description="The unique ID for this attachment.") + signer: Union[StrictStr, StrictInt] = Field(description="The Signer this attachment is assigned to.") + name: StrictStr = Field(description="The name of this attachment.") + required: StrictBool = Field(description="A boolean value denoting if this attachment is required.") + instructions: Optional[StrictStr] = Field(default=None, description="Instructions for Signer.") + uploaded_at: Optional[StrictInt] = Field(default=None, description="Timestamp when attachment was uploaded by Signer.") + __properties: ClassVar[List[str]] = ["id", "signer", "name", "required", "instructions", "uploaded_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseAttachment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseAttachment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "signer": obj.get("signer"), + "name": obj.get("name"), + "required": obj.get("required"), + "instructions": obj.get("instructions"), + "uploaded_at": obj.get("uploaded_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "id": "(str,)", + "signer": "(int, str,)", + "name": "(str,)", + "required": "(bool,)", + "instructions": "(str,)", + "uploaded_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_custom_field_base.py b/dropbox_sign/models/signature_request_response_custom_field_base.py new file mode 100644 index 0000000..4f320f3 --- /dev/null +++ b/dropbox_sign/models/signature_request_response_custom_field_base.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.signature_request_response_custom_field_checkbox import SignatureRequestResponseCustomFieldCheckbox + from dropbox_sign.models.signature_request_response_custom_field_text import SignatureRequestResponseCustomFieldText + +class SignatureRequestResponseCustomFieldBase(BaseModel): + """ + An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") + name: StrictStr = Field(description="The name of the Custom Field.") + required: Optional[StrictBool] = Field(default=None, description="A boolean value denoting if this field is required.") + api_id: Optional[StrictStr] = Field(default=None, description="The unique ID for this field.") + editor: Optional[StrictStr] = Field(default=None, description="The name of the Role that is able to edit this field.") + __properties: ClassVar[List[str]] = ["type", "name", "required", "api_id", "editor"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'SignatureRequestResponseCustomFieldCheckbox','text': 'SignatureRequestResponseCustomFieldText' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText]]: + """Create an instance of SignatureRequestResponseCustomFieldBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[SignatureRequestResponseCustomFieldCheckbox, SignatureRequestResponseCustomFieldText]]: + """Create an instance of SignatureRequestResponseCustomFieldBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'SignatureRequestResponseCustomFieldCheckbox': + return import_module("dropbox_sign.models.signature_request_response_custom_field_checkbox").SignatureRequestResponseCustomFieldCheckbox.from_dict(obj) + if object_type == 'SignatureRequestResponseCustomFieldText': + return import_module("dropbox_sign.models.signature_request_response_custom_field_text").SignatureRequestResponseCustomFieldText.from_dict(obj) + + raise ValueError("SignatureRequestResponseCustomFieldBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "name": "(str,)", + "required": "(bool,)", + "api_id": "(str,)", + "editor": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_custom_field_checkbox.py b/dropbox_sign/models/signature_request_response_custom_field_checkbox.py new file mode 100644 index 0000000..e0ca673 --- /dev/null +++ b/dropbox_sign/models/signature_request_response_custom_field_checkbox.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseCustomFieldCheckbox(SignatureRequestResponseCustomFieldBase): + """ + This class extends `SignatureRequestResponseCustomFieldBase`. + """ # noqa: E501 + type: StrictStr = Field(description="The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") + value: Optional[StrictBool] = Field(default=None, description="A true/false for checkbox fields") + __properties: ClassVar[List[str]] = ["type", "name", "required", "api_id", "editor", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseCustomFieldCheckbox from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseCustomFieldCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "name": obj.get("name"), + "required": obj.get("required"), + "api_id": obj.get("api_id"), + "editor": obj.get("editor"), + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "name": "(str,)", + "value": "(bool,)", + "required": "(bool,)", + "api_id": "(str,)", + "editor": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_custom_field_text.py b/dropbox_sign/models/signature_request_response_custom_field_text.py new file mode 100644 index 0000000..7ee2fe8 --- /dev/null +++ b/dropbox_sign/models/signature_request_response_custom_field_text.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_custom_field_base import SignatureRequestResponseCustomFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseCustomFieldText(SignatureRequestResponseCustomFieldBase): + """ + This class extends `SignatureRequestResponseCustomFieldBase`. + """ # noqa: E501 + type: StrictStr = Field(description="The type of this Custom Field. Only 'text' and 'checkbox' are currently supported.") + value: Optional[StrictStr] = Field(default=None, description="A text string for text fields") + __properties: ClassVar[List[str]] = ["type", "name", "required", "api_id", "editor", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseCustomFieldText from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseCustomFieldText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'text', + "name": obj.get("name"), + "required": obj.get("required"), + "api_id": obj.get("api_id"), + "editor": obj.get("editor"), + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "name": "(str,)", + "value": "(str,)", + "required": "(bool,)", + "api_id": "(str,)", + "editor": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_custom_field_type_enum.py b/dropbox_sign/models/signature_request_response_custom_field_type_enum.py new file mode 100644 index 0000000..b8cd0e7 --- /dev/null +++ b/dropbox_sign/models/signature_request_response_custom_field_type_enum.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SignatureRequestResponseCustomFieldTypeEnum(str, Enum): + """ + SignatureRequestResponseCustomFieldTypeEnum + """ + + """ + allowed enum values + """ + TEXT = 'text' + CHECKBOX = 'checkbox' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SignatureRequestResponseCustomFieldTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dropbox_sign/models/signature_request_response_data_base.py b/dropbox_sign/models/signature_request_response_data_base.py new file mode 100644 index 0000000..4e9f139 --- /dev/null +++ b/dropbox_sign/models/signature_request_response_data_base.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.signature_request_response_data_value_checkbox import SignatureRequestResponseDataValueCheckbox + from dropbox_sign.models.signature_request_response_data_value_checkbox_merge import SignatureRequestResponseDataValueCheckboxMerge + from dropbox_sign.models.signature_request_response_data_value_date_signed import SignatureRequestResponseDataValueDateSigned + from dropbox_sign.models.signature_request_response_data_value_dropdown import SignatureRequestResponseDataValueDropdown + from dropbox_sign.models.signature_request_response_data_value_initials import SignatureRequestResponseDataValueInitials + from dropbox_sign.models.signature_request_response_data_value_radio import SignatureRequestResponseDataValueRadio + from dropbox_sign.models.signature_request_response_data_value_signature import SignatureRequestResponseDataValueSignature + from dropbox_sign.models.signature_request_response_data_value_text import SignatureRequestResponseDataValueText + from dropbox_sign.models.signature_request_response_data_value_text_merge import SignatureRequestResponseDataValueTextMerge + +class SignatureRequestResponseDataBase(BaseModel): + """ + An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. + """ # noqa: E501 + api_id: Optional[StrictStr] = Field(default=None, description="The unique ID for this field.") + signature_id: Optional[StrictStr] = Field(default=None, description="The ID of the signature to which this response is linked.") + name: Optional[StrictStr] = Field(default=None, description="The name of the form field.") + required: Optional[StrictBool] = Field(default=None, description="A boolean value denoting if this field is required.") + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'SignatureRequestResponseDataValueCheckbox','checkbox-merge': 'SignatureRequestResponseDataValueCheckboxMerge','date_signed': 'SignatureRequestResponseDataValueDateSigned','dropdown': 'SignatureRequestResponseDataValueDropdown','initials': 'SignatureRequestResponseDataValueInitials','radio': 'SignatureRequestResponseDataValueRadio','signature': 'SignatureRequestResponseDataValueSignature','text': 'SignatureRequestResponseDataValueText','text-merge': 'SignatureRequestResponseDataValueTextMerge' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge]]: + """Create an instance of SignatureRequestResponseDataBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[SignatureRequestResponseDataValueCheckbox, SignatureRequestResponseDataValueCheckboxMerge, SignatureRequestResponseDataValueDateSigned, SignatureRequestResponseDataValueDropdown, SignatureRequestResponseDataValueInitials, SignatureRequestResponseDataValueRadio, SignatureRequestResponseDataValueSignature, SignatureRequestResponseDataValueText, SignatureRequestResponseDataValueTextMerge]]: + """Create an instance of SignatureRequestResponseDataBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'SignatureRequestResponseDataValueCheckbox': + return import_module("dropbox_sign.models.signature_request_response_data_value_checkbox").SignatureRequestResponseDataValueCheckbox.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueCheckboxMerge': + return import_module("dropbox_sign.models.signature_request_response_data_value_checkbox_merge").SignatureRequestResponseDataValueCheckboxMerge.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueDateSigned': + return import_module("dropbox_sign.models.signature_request_response_data_value_date_signed").SignatureRequestResponseDataValueDateSigned.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueDropdown': + return import_module("dropbox_sign.models.signature_request_response_data_value_dropdown").SignatureRequestResponseDataValueDropdown.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueInitials': + return import_module("dropbox_sign.models.signature_request_response_data_value_initials").SignatureRequestResponseDataValueInitials.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueRadio': + return import_module("dropbox_sign.models.signature_request_response_data_value_radio").SignatureRequestResponseDataValueRadio.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueSignature': + return import_module("dropbox_sign.models.signature_request_response_data_value_signature").SignatureRequestResponseDataValueSignature.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueText': + return import_module("dropbox_sign.models.signature_request_response_data_value_text").SignatureRequestResponseDataValueText.from_dict(obj) + if object_type == 'SignatureRequestResponseDataValueTextMerge': + return import_module("dropbox_sign.models.signature_request_response_data_value_text_merge").SignatureRequestResponseDataValueTextMerge.from_dict(obj) + + raise ValueError("SignatureRequestResponseDataBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + "type": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_data_type_enum.py b/dropbox_sign/models/signature_request_response_data_type_enum.py new file mode 100644 index 0000000..17f8831 --- /dev/null +++ b/dropbox_sign/models/signature_request_response_data_type_enum.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SignatureRequestResponseDataTypeEnum(str, Enum): + """ + SignatureRequestResponseDataTypeEnum + """ + + """ + allowed enum values + """ + TEXT = 'text' + CHECKBOX = 'checkbox' + DATE_SIGNED = 'date_signed' + DROPDOWN = 'dropdown' + INITIALS = 'initials' + RADIO = 'radio' + SIGNATURE = 'signature' + TEXT_MINUS_MERGE = 'text-merge' + CHECKBOX_MINUS_MERGE = 'checkbox-merge' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SignatureRequestResponseDataTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dropbox_sign/models/signature_request_response_data_value_checkbox.py b/dropbox_sign/models/signature_request_response_data_value_checkbox.py new file mode 100644 index 0000000..658f917 --- /dev/null +++ b/dropbox_sign/models/signature_request_response_data_value_checkbox.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueCheckbox(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueCheckbox + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='checkbox', description="A yes/no checkbox") + value: Optional[StrictBool] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueCheckbox from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "value": "(bool,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_data_value_checkbox_merge.py b/dropbox_sign/models/signature_request_response_data_value_checkbox_merge.py new file mode 100644 index 0000000..e391d75 --- /dev/null +++ b/dropbox_sign/models/signature_request_response_data_value_checkbox_merge.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueCheckboxMerge(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueCheckboxMerge + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='checkbox-merge', description="A checkbox field that has default value set by the api") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueCheckboxMerge from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueCheckboxMerge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'checkbox-merge', + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_data_value_date_signed.py b/dropbox_sign/models/signature_request_response_data_value_date_signed.py new file mode 100644 index 0000000..e7508f9 --- /dev/null +++ b/dropbox_sign/models/signature_request_response_data_value_date_signed.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueDateSigned(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueDateSigned + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='date_signed', description="A date") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueDateSigned from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueDateSigned from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'date_signed', + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_data_value_dropdown.py b/dropbox_sign/models/signature_request_response_data_value_dropdown.py new file mode 100644 index 0000000..bf79e05 --- /dev/null +++ b/dropbox_sign/models/signature_request_response_data_value_dropdown.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueDropdown(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueDropdown + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='dropdown', description="An input field for dropdowns") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueDropdown from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueDropdown from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'dropdown', + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_data_value_initials.py b/dropbox_sign/models/signature_request_response_data_value_initials.py new file mode 100644 index 0000000..eb8b8ac --- /dev/null +++ b/dropbox_sign/models/signature_request_response_data_value_initials.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueInitials(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueInitials + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='initials', description="An input field for initials") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueInitials from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueInitials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'initials', + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_data_value_radio.py b/dropbox_sign/models/signature_request_response_data_value_radio.py new file mode 100644 index 0000000..8c7c734 --- /dev/null +++ b/dropbox_sign/models/signature_request_response_data_value_radio.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueRadio(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueRadio + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='radio', description="An input field for radios") + value: Optional[StrictBool] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueRadio from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueRadio from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'radio', + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "value": "(bool,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_data_value_signature.py b/dropbox_sign/models/signature_request_response_data_value_signature.py new file mode 100644 index 0000000..589801d --- /dev/null +++ b/dropbox_sign/models/signature_request_response_data_value_signature.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueSignature(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueSignature + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='signature', description="A signature input field") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueSignature from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueSignature from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'signature', + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_data_value_text.py b/dropbox_sign/models/signature_request_response_data_value_text.py new file mode 100644 index 0000000..2bfb27d --- /dev/null +++ b/dropbox_sign/models/signature_request_response_data_value_text.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueText(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueText + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='text', description="A text input field") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueText from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'text', + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_data_value_text_merge.py b/dropbox_sign/models/signature_request_response_data_value_text_merge.py new file mode 100644 index 0000000..518dc2c --- /dev/null +++ b/dropbox_sign/models/signature_request_response_data_value_text_merge.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.signature_request_response_data_base import SignatureRequestResponseDataBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseDataValueTextMerge(SignatureRequestResponseDataBase): + """ + SignatureRequestResponseDataValueTextMerge + """ # noqa: E501 + type: Optional[StrictStr] = Field(default='text-merge', description="A text field that has default text set by the api") + value: Optional[StrictStr] = Field(default=None, description="The value of the form field.") + __properties: ClassVar[List[str]] = ["api_id", "signature_id", "name", "required", "type", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueTextMerge from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseDataValueTextMerge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_id": obj.get("api_id"), + "signature_id": obj.get("signature_id"), + "name": obj.get("name"), + "required": obj.get("required"), + "type": obj.get("type") if obj.get("type") is not None else 'text-merge', + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "value": "(str,)", + "api_id": "(str,)", + "signature_id": "(str,)", + "name": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_response_signatures.py b/dropbox_sign/models/signature_request_response_signatures.py new file mode 100644 index 0000000..da2db2e --- /dev/null +++ b/dropbox_sign/models/signature_request_response_signatures.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestResponseSignatures(BaseModel): + """ + An array of signature objects, 1 for each signer. + """ # noqa: E501 + signature_id: Optional[StrictStr] = Field(default=None, description="Signature identifier.") + signer_group_guid: Optional[StrictStr] = Field(default=None, description="Signer Group GUID") + signer_email_address: Optional[StrictStr] = Field(default=None, description="The email address of the signer.") + signer_name: Optional[StrictStr] = Field(default=None, description="The name of the signer.") + signer_role: Optional[StrictStr] = Field(default=None, description="The role of the signer.") + order: Optional[StrictInt] = Field(default=None, description="If signer order is assigned this is the 0-based index for this signer.") + status_code: Optional[StrictStr] = Field(default=None, description="The current status of the signature. eg: awaiting_signature, signed, declined.") + decline_reason: Optional[StrictStr] = Field(default=None, description="The reason provided by the signer for declining the request.") + signed_at: Optional[StrictInt] = Field(default=None, description="Time that the document was signed or null.") + last_viewed_at: Optional[StrictInt] = Field(default=None, description="The time that the document was last viewed by this signer or null.") + last_reminded_at: Optional[StrictInt] = Field(default=None, description="The time the last reminder email was sent to the signer or null.") + has_pin: Optional[StrictBool] = Field(default=None, description="Boolean to indicate whether this signature requires a PIN to access.") + has_sms_auth: Optional[StrictBool] = Field(default=None, description="Boolean to indicate whether this signature has SMS authentication enabled.") + has_sms_delivery: Optional[StrictBool] = Field(default=None, description="Boolean to indicate whether this signature has SMS delivery enabled.") + sms_phone_number: Optional[StrictStr] = Field(default=None, description="The SMS phone number used for authentication or signature request delivery.") + reassigned_by: Optional[StrictStr] = Field(default=None, description="Email address of original signer who reassigned to this signer.") + reassignment_reason: Optional[StrictStr] = Field(default=None, description="Reason provided by original signer who reassigned to this signer.") + reassigned_from: Optional[StrictStr] = Field(default=None, description="Previous signature identifier.") + error: Optional[StrictStr] = Field(default=None, description="Error message pertaining to this signer, or null.") + __properties: ClassVar[List[str]] = ["signature_id", "signer_group_guid", "signer_email_address", "signer_name", "signer_role", "order", "status_code", "decline_reason", "signed_at", "last_viewed_at", "last_reminded_at", "has_pin", "has_sms_auth", "has_sms_delivery", "sms_phone_number", "reassigned_by", "reassignment_reason", "reassigned_from", "error"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestResponseSignatures from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestResponseSignatures from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "signature_id": obj.get("signature_id"), + "signer_group_guid": obj.get("signer_group_guid"), + "signer_email_address": obj.get("signer_email_address"), + "signer_name": obj.get("signer_name"), + "signer_role": obj.get("signer_role"), + "order": obj.get("order"), + "status_code": obj.get("status_code"), + "decline_reason": obj.get("decline_reason"), + "signed_at": obj.get("signed_at"), + "last_viewed_at": obj.get("last_viewed_at"), + "last_reminded_at": obj.get("last_reminded_at"), + "has_pin": obj.get("has_pin"), + "has_sms_auth": obj.get("has_sms_auth"), + "has_sms_delivery": obj.get("has_sms_delivery"), + "sms_phone_number": obj.get("sms_phone_number"), + "reassigned_by": obj.get("reassigned_by"), + "reassignment_reason": obj.get("reassignment_reason"), + "reassigned_from": obj.get("reassigned_from"), + "error": obj.get("error") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "signature_id": "(str,)", + "signer_group_guid": "(str,)", + "signer_email_address": "(str,)", + "signer_name": "(str,)", + "signer_role": "(str,)", + "order": "(int,)", + "status_code": "(str,)", + "decline_reason": "(str,)", + "signed_at": "(int,)", + "last_viewed_at": "(int,)", + "last_reminded_at": "(int,)", + "has_pin": "(bool,)", + "has_sms_auth": "(bool,)", + "has_sms_delivery": "(bool,)", + "sms_phone_number": "(str,)", + "reassigned_by": "(str,)", + "reassignment_reason": "(str,)", + "reassigned_from": "(str,)", + "error": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/signature_request_send_request.py b/dropbox_sign/models/signature_request_send_request.py new file mode 100644 index 0000000..a6744fa --- /dev/null +++ b/dropbox_sign/models/signature_request_send_request.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_signature_request_grouped_signers import SubSignatureRequestGroupedSigners +from dropbox_sign.models.sub_signature_request_signer import SubSignatureRequestSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestSendRequest(BaseModel): + """ + SignatureRequestSendRequest + """ # noqa: E501 + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + signers: Optional[List[SubSignatureRequestSigner]] = Field(default=None, description="Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") + grouped_signers: Optional[List[SubSignatureRequestGroupedSigners]] = Field(default=None, description="Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="The email addresses that should be CCed.") + client_id: Optional[StrictStr] = Field(default=None, description="The client id of the API App you want to associate with this request. Used to apply the branding and callback url defined for the app.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + field_options: Optional[SubFieldOptions] = None + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field(default=None, description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + hide_text_tags: Optional[StrictBool] = Field(default=False, description="Enables automatic Text Tag removal when set to true. **NOTE:** Removing text tags this way can cause unwanted clipping. We recommend leaving this setting on `false` and instead hiding your text tags using white text or a similar approach. See the [Text Tags Walkthrough](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) for more information.") + is_qualified_signature: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.") + is_eid: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + use_text_tags: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document. Defaults to disabled, or `false`.") + expires_at: Optional[StrictInt] = Field(default=None, description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") + __properties: ClassVar[List[str]] = ["files", "file_urls", "signers", "grouped_signers", "allow_decline", "allow_reassign", "attachments", "cc_email_addresses", "client_id", "custom_fields", "field_options", "form_field_groups", "form_field_rules", "form_fields_per_document", "hide_text_tags", "is_qualified_signature", "is_eid", "message", "metadata", "signing_options", "signing_redirect_url", "subject", "test_mode", "title", "use_text_tags", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestSendRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in grouped_signers (list) + _items = [] + if self.grouped_signers: + for _item_grouped_signers in self.grouped_signers: + if _item_grouped_signers: + _items.append(_item_grouped_signers.to_dict()) + _dict['grouped_signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestSendRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "signers": [SubSignatureRequestSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "grouped_signers": [SubSignatureRequestGroupedSigners.from_dict(_item) for _item in obj["grouped_signers"]] if obj.get("grouped_signers") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_email_addresses": obj.get("cc_email_addresses"), + "client_id": obj.get("client_id"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "hide_text_tags": obj.get("hide_text_tags") if obj.get("hide_text_tags") is not None else False, + "is_qualified_signature": obj.get("is_qualified_signature") if obj.get("is_qualified_signature") is not None else False, + "is_eid": obj.get("is_eid") if obj.get("is_eid") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "use_text_tags": obj.get("use_text_tags") if obj.get("use_text_tags") is not None else False, + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "signers": "(List[SubSignatureRequestSigner],)", + "grouped_signers": "(List[SubSignatureRequestGroupedSigners],)", + "allow_decline": "(bool,)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_email_addresses": "(List[str],)", + "client_id": "(str,)", + "custom_fields": "(List[SubCustomField],)", + "field_options": "(SubFieldOptions,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "hide_text_tags": "(bool,)", + "is_qualified_signature": "(bool,)", + "is_eid": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "use_text_tags": "(bool,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "signers", + "grouped_signers", + "attachments", + "cc_email_addresses", + "custom_fields", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + ] + diff --git a/dropbox_sign/models/signature_request_send_with_template_request.py b/dropbox_sign/models/signature_request_send_with_template_request.py new file mode 100644 index 0000000..36e806a --- /dev/null +++ b/dropbox_sign/models/signature_request_send_with_template_request.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestSendWithTemplateRequest(BaseModel): + """ + + """ # noqa: E501 + template_ids: List[StrictStr] = Field(description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used.") + signers: List[SubSignatureRequestTemplateSigner] = Field(description="Add Signers to your Templated-based Signature Request.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + ccs: Optional[List[SubCC]] = Field(default=None, description="Add CC email recipients. Required when a CC role exists for the Template.") + client_id: Optional[StrictStr] = Field(default=None, description="Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="An array defining values and options for custom fields. Required when a custom field exists in the Template.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + is_qualified_signature: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [Qualified Electronic Signatures](https://www.hellosign.com/features/qualified-electronic-signatures) (QES), which requires a face-to-face call to verify the signer's identity.
**NOTE:** QES is only available on the Premium API plan as an add-on purchase. Cannot be used in `test_mode`. Only works on requests with one signer.") + is_eid: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.
**NOTE:** eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + __properties: ClassVar[List[str]] = ["template_ids", "signers", "allow_decline", "ccs", "client_id", "custom_fields", "files", "file_urls", "is_qualified_signature", "is_eid", "message", "metadata", "signing_options", "signing_redirect_url", "subject", "test_mode", "title"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestSendWithTemplateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict['ccs'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestSendWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_ids": obj.get("template_ids"), + "signers": [SubSignatureRequestTemplateSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "ccs": [SubCC.from_dict(_item) for _item in obj["ccs"]] if obj.get("ccs") is not None else None, + "client_id": obj.get("client_id"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "is_qualified_signature": obj.get("is_qualified_signature") if obj.get("is_qualified_signature") is not None else False, + "is_eid": obj.get("is_eid") if obj.get("is_eid") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_ids": "(List[str],)", + "signers": "(List[SubSignatureRequestTemplateSigner],)", + "allow_decline": "(bool,)", + "ccs": "(List[SubCC],)", + "client_id": "(str,)", + "custom_fields": "(List[SubCustomField],)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "is_qualified_signature": "(bool,)", + "is_eid": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "signers", + "ccs", + "custom_fields", + "files", + "file_urls", + ] + diff --git a/dropbox_sign/models/signature_request_update_request.py b/dropbox_sign/models/signature_request_update_request.py new file mode 100644 index 0000000..0f9b554 --- /dev/null +++ b/dropbox_sign/models/signature_request_update_request.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SignatureRequestUpdateRequest(BaseModel): + """ + SignatureRequestUpdateRequest + """ # noqa: E501 + signature_id: StrictStr = Field(description="The signature ID for the recipient.") + email_address: Optional[StrictStr] = Field(default=None, description="The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided.") + name: Optional[StrictStr] = Field(default=None, description="The new name for the recipient. **NOTE:** Optional if `email_address` is provided.") + expires_at: Optional[StrictInt] = Field(default=None, description="The new time when the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details.") + __properties: ClassVar[List[str]] = ["signature_id", "email_address", "name", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SignatureRequestUpdateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SignatureRequestUpdateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "signature_id": obj.get("signature_id"), + "email_address": obj.get("email_address"), + "name": obj.get("name"), + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "signature_id": "(str,)", + "email_address": "(str,)", + "name": "(str,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_attachment.py b/dropbox_sign/models/sub_attachment.py new file mode 100644 index 0000000..200c6a5 --- /dev/null +++ b/dropbox_sign/models/sub_attachment.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubAttachment(BaseModel): + """ + SubAttachment + """ # noqa: E501 + name: StrictStr = Field(description="The name of attachment.") + signer_index: StrictInt = Field(description="The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment.") + instructions: Optional[StrictStr] = Field(default=None, description="The instructions for uploading the attachment.") + required: Optional[StrictBool] = Field(default=False, description="Determines if the attachment must be uploaded.") + __properties: ClassVar[List[str]] = ["name", "signer_index", "instructions", "required"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubAttachment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubAttachment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "signer_index": obj.get("signer_index"), + "instructions": obj.get("instructions"), + "required": obj.get("required") if obj.get("required") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + "signer_index": "(int,)", + "instructions": "(str,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_bulk_signer_list.py b/dropbox_sign/models/sub_bulk_signer_list.py new file mode 100644 index 0000000..06991db --- /dev/null +++ b/dropbox_sign/models/sub_bulk_signer_list.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_bulk_signer_list_custom_field import SubBulkSignerListCustomField +from dropbox_sign.models.sub_signature_request_template_signer import SubSignatureRequestTemplateSigner +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubBulkSignerList(BaseModel): + """ + SubBulkSignerList + """ # noqa: E501 + custom_fields: Optional[List[SubBulkSignerListCustomField]] = Field(default=None, description="An array of custom field values.") + signers: Optional[List[SubSignatureRequestTemplateSigner]] = Field(default=None, description="Add Signers to your Templated-based Signature Request. Allows the requester to specify editor options when a preparing a document. Currently only templates with a single role are supported. All signers must have the same `role` value.") + __properties: ClassVar[List[str]] = ["custom_fields", "signers"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubBulkSignerList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubBulkSignerList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "custom_fields": [SubBulkSignerListCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "signers": [SubSignatureRequestTemplateSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "custom_fields": "(List[SubBulkSignerListCustomField],)", + "signers": "(List[SubSignatureRequestTemplateSigner],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "custom_fields", + "signers", + ] + diff --git a/dropbox_sign/models/sub_bulk_signer_list_custom_field.py b/dropbox_sign/models/sub_bulk_signer_list_custom_field.py new file mode 100644 index 0000000..2a171a1 --- /dev/null +++ b/dropbox_sign/models/sub_bulk_signer_list_custom_field.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubBulkSignerListCustomField(BaseModel): + """ + SubBulkSignerListCustomField + """ # noqa: E501 + name: StrictStr = Field(description="The name of the custom field. Must be the field's `name` or `api_id`.") + value: StrictStr = Field(description="The value of the custom field.") + __properties: ClassVar[List[str]] = ["name", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubBulkSignerListCustomField from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubBulkSignerListCustomField from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + "value": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_cc.py b/dropbox_sign/models/sub_cc.py new file mode 100644 index 0000000..840897e --- /dev/null +++ b/dropbox_sign/models/sub_cc.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubCC(BaseModel): + """ + SubCC + """ # noqa: E501 + role: StrictStr = Field(description="Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role.") + email_address: StrictStr = Field(description="The email address of the CC recipient.") + __properties: ClassVar[List[str]] = ["role", "email_address"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubCC from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubCC from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "role": obj.get("role"), + "email_address": obj.get("email_address") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "role": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_custom_field.py b/dropbox_sign/models/sub_custom_field.py new file mode 100644 index 0000000..ac22b98 --- /dev/null +++ b/dropbox_sign/models/sub_custom_field.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubCustomField(BaseModel): + """ + When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template. + """ # noqa: E501 + name: StrictStr = Field(description="The name of a custom field. When working with pre-filled data, the custom field's name must have a matching merge field name or the field will remain empty on the document during signing.") + editor: Optional[StrictStr] = Field(default=None, description="Used to create editable merge fields. When the value matches a role passed in with `signers`, that role can edit the data that was pre-filled to that field. This field is optional, but required when this custom field object is set to `required = true`. **NOTE:** Editable merge fields are only supported for single signer requests (or the first signer in ordered signature requests). If used when there are multiple signers in an unordered signature request, the editor value is ignored and the field won't be editable.") + required: Optional[StrictBool] = Field(default=False, description="Used to set an editable merge field when working with pre-filled data. When `true`, the custom field must specify a signer role in `editor`.") + value: Optional[StrictStr] = Field(default=None, description="The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing.") + __properties: ClassVar[List[str]] = ["name", "editor", "required", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubCustomField from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubCustomField from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "editor": obj.get("editor"), + "required": obj.get("required") if obj.get("required") is not None else False, + "value": obj.get("value") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + "editor": "(str,)", + "required": "(bool,)", + "value": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_editor_options.py b/dropbox_sign/models/sub_editor_options.py new file mode 100644 index 0000000..fbe6ecb --- /dev/null +++ b/dropbox_sign/models/sub_editor_options.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubEditorOptions(BaseModel): + """ + This allows the requester to specify editor options when a preparing a document + """ # noqa: E501 + allow_edit_signers: Optional[StrictBool] = Field(default=False, description="Allows requesters to edit the list of signers") + allow_edit_documents: Optional[StrictBool] = Field(default=False, description="Allows requesters to edit documents, including delete and add") + __properties: ClassVar[List[str]] = ["allow_edit_signers", "allow_edit_documents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubEditorOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubEditorOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow_edit_signers": obj.get("allow_edit_signers") if obj.get("allow_edit_signers") is not None else False, + "allow_edit_documents": obj.get("allow_edit_documents") if obj.get("allow_edit_documents") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "allow_edit_signers": "(bool,)", + "allow_edit_documents": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_field_options.py b/dropbox_sign/models/sub_field_options.py new file mode 100644 index 0000000..1541358 --- /dev/null +++ b/dropbox_sign/models/sub_field_options.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFieldOptions(BaseModel): + """ + This allows the requester to specify field options for a signature request. + """ # noqa: E501 + date_format: StrictStr = Field(description="Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher.") + __properties: ClassVar[List[str]] = ["date_format"] + + @field_validator('date_format') + def date_format_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['MM / DD / YYYY', 'MM - DD - YYYY', 'DD / MM / YYYY', 'DD - MM - YYYY', 'YYYY / MM / DD', 'YYYY - MM - DD']): + raise ValueError("must be one of enum values ('MM / DD / YYYY', 'MM - DD - YYYY', 'DD / MM / YYYY', 'DD - MM - YYYY', 'YYYY / MM / DD', 'YYYY - MM - DD')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFieldOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFieldOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date_format": obj.get("date_format") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "date_format": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_field_group.py b/dropbox_sign/models/sub_form_field_group.py new file mode 100644 index 0000000..ee3dcb9 --- /dev/null +++ b/dropbox_sign/models/sub_form_field_group.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldGroup(BaseModel): + """ + SubFormFieldGroup + """ # noqa: E501 + group_id: StrictStr = Field(description="ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`.") + group_label: StrictStr = Field(description="Name of the group") + requirement: StrictStr = Field(description="Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.") + __properties: ClassVar[List[str]] = ["group_id", "group_label", "requirement"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "group_id": obj.get("group_id"), + "group_label": obj.get("group_label"), + "requirement": obj.get("requirement") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "group_id": "(str,)", + "group_label": "(str,)", + "requirement": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_field_rule.py b/dropbox_sign/models/sub_form_field_rule.py new file mode 100644 index 0000000..bd26802 --- /dev/null +++ b/dropbox_sign/models/sub_form_field_rule.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from dropbox_sign.models.sub_form_field_rule_action import SubFormFieldRuleAction +from dropbox_sign.models.sub_form_field_rule_trigger import SubFormFieldRuleTrigger +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldRule(BaseModel): + """ + SubFormFieldRule + """ # noqa: E501 + id: StrictStr = Field(description="Must be unique across all defined rules.") + trigger_operator: StrictStr = Field(description="Currently only `AND` is supported. Support for `OR` is being worked on.") + triggers: Annotated[List[SubFormFieldRuleTrigger], Field(min_length=1, max_length=1)] = Field(description="An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed.") + actions: Annotated[List[SubFormFieldRuleAction], Field(min_length=1)] = Field(description="An array of action definitions, the \"then that\" part of \"if this, **then that**\". Any number of actions may be attached to a single rule.") + __properties: ClassVar[List[str]] = ["id", "trigger_operator", "triggers", "actions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldRule from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in triggers (list) + _items = [] + if self.triggers: + for _item_triggers in self.triggers: + if _item_triggers: + _items.append(_item_triggers.to_dict()) + _dict['triggers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in actions (list) + _items = [] + if self.actions: + for _item_actions in self.actions: + if _item_actions: + _items.append(_item_actions.to_dict()) + _dict['actions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldRule from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "trigger_operator": obj.get("trigger_operator") if obj.get("trigger_operator") is not None else 'AND', + "triggers": [SubFormFieldRuleTrigger.from_dict(_item) for _item in obj["triggers"]] if obj.get("triggers") is not None else None, + "actions": [SubFormFieldRuleAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "id": "(str,)", + "trigger_operator": "(str,)", + "triggers": "(List[SubFormFieldRuleTrigger],)", + "actions": "(List[SubFormFieldRuleAction],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "triggers", + "actions", + ] + diff --git a/dropbox_sign/models/sub_form_field_rule_action.py b/dropbox_sign/models/sub_form_field_rule_action.py new file mode 100644 index 0000000..b9deef4 --- /dev/null +++ b/dropbox_sign/models/sub_form_field_rule_action.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldRuleAction(BaseModel): + """ + SubFormFieldRuleAction + """ # noqa: E501 + hidden: StrictBool = Field(description="`true` to hide the target field when rule is satisfied, otherwise `false`.") + type: StrictStr + field_id: Optional[StrictStr] = Field(default=None, description="**field_id** or **group_id** is required, but not both. Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Cannot use with `group_id`. Trigger and action fields must belong to the same signer.") + group_id: Optional[StrictStr] = Field(default=None, description="**group_id** or **field_id** is required, but not both. Must reference the ID of an existing group defined within `form_field_groups`. Cannot use with `field_id`. Trigger and action fields and groups must belong to the same signer.") + __properties: ClassVar[List[str]] = ["hidden", "type", "field_id", "group_id"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['change-field-visibility', 'change-group-visibility']): + raise ValueError("must be one of enum values ('change-field-visibility', 'change-group-visibility')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldRuleAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldRuleAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hidden": obj.get("hidden"), + "type": obj.get("type"), + "field_id": obj.get("field_id"), + "group_id": obj.get("group_id") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "hidden": "(bool,)", + "type": "(str,)", + "field_id": "(str,)", + "group_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_field_rule_trigger.py b/dropbox_sign/models/sub_form_field_rule_trigger.py new file mode 100644 index 0000000..888fc01 --- /dev/null +++ b/dropbox_sign/models/sub_form_field_rule_trigger.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldRuleTrigger(BaseModel): + """ + SubFormFieldRuleTrigger + """ # noqa: E501 + id: StrictStr = Field(description="Must reference the `api_id` of an existing field defined within `form_fields_per_document`. Trigger and action fields and groups must belong to the same signer.") + operator: StrictStr = Field(description="Different field types allow different `operator` values: - Field type of **text**: - **is**: exact match - **not**: not exact match - **match**: regular expression, without /. Example: - OK `[a-zA-Z0-9]` - Not OK `/[a-zA-Z0-9]/` - Field type of **dropdown**: - **is**: exact match, single value - **not**: not exact match, single value - **any**: exact match, array of values. - **none**: not exact match, array of values. - Field type of **checkbox**: - **is**: exact match, single value - **not**: not exact match, single value - Field type of **radio**: - **is**: exact match, single value - **not**: not exact match, single value") + value: Optional[StrictStr] = Field(default=None, description="**value** or **values** is required, but not both. The value to match against **operator**. - When **operator** is one of the following, **value** must be `String`: - `is` - `not` - `match` Otherwise, - **checkbox**: When **type** of trigger is **checkbox**, **value** must be `0` or `1` - **radio**: When **type** of trigger is **radio**, **value** must be `1`") + values: Optional[List[StrictStr]] = Field(default=None, description="**values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none`") + __properties: ClassVar[List[str]] = ["id", "operator", "value", "values"] + + @field_validator('operator') + def operator_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['any', 'is', 'match', 'none', 'not']): + raise ValueError("must be one of enum values ('any', 'is', 'match', 'none', 'not')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldRuleTrigger from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldRuleTrigger from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "operator": obj.get("operator"), + "value": obj.get("value"), + "values": obj.get("values") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "id": "(str,)", + "operator": "(str,)", + "value": "(str,)", + "values": "(List[str],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "values", + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_base.py b/dropbox_sign/models/sub_form_fields_per_document_base.py new file mode 100644 index 0000000..3209cd0 --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_base.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.sub_form_fields_per_document_checkbox import SubFormFieldsPerDocumentCheckbox + from dropbox_sign.models.sub_form_fields_per_document_checkbox_merge import SubFormFieldsPerDocumentCheckboxMerge + from dropbox_sign.models.sub_form_fields_per_document_date_signed import SubFormFieldsPerDocumentDateSigned + from dropbox_sign.models.sub_form_fields_per_document_dropdown import SubFormFieldsPerDocumentDropdown + from dropbox_sign.models.sub_form_fields_per_document_hyperlink import SubFormFieldsPerDocumentHyperlink + from dropbox_sign.models.sub_form_fields_per_document_initials import SubFormFieldsPerDocumentInitials + from dropbox_sign.models.sub_form_fields_per_document_radio import SubFormFieldsPerDocumentRadio + from dropbox_sign.models.sub_form_fields_per_document_signature import SubFormFieldsPerDocumentSignature + from dropbox_sign.models.sub_form_fields_per_document_text import SubFormFieldsPerDocumentText + from dropbox_sign.models.sub_form_fields_per_document_text_merge import SubFormFieldsPerDocumentTextMerge + +class SubFormFieldsPerDocumentBase(BaseModel): + """ + The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge` + """ # noqa: E501 + document_index: StrictInt = Field(description="Represents the integer index of the `file` or `file_url` document the field should be attached to.") + api_id: StrictStr = Field(description="An identifier for the field that is unique across all documents in the request.") + height: StrictInt = Field(description="Size of the field in pixels.") + required: StrictBool = Field(description="Whether this field is required.") + signer: Union[StrictStr, StrictInt] = Field(description="Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE:** To set the value of the field as the preparer you must set this to `me_now` **NOTE:** If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data.") + type: StrictStr + width: StrictInt = Field(description="Size of the field in pixels.") + x: StrictInt = Field(description="Location coordinates of the field in pixels.") + y: StrictInt = Field(description="Location coordinates of the field in pixels.") + name: Optional[StrictStr] = Field(default=None, description="Display name for the field.") + page: Optional[StrictInt] = Field(default=None, description="Page in the document where the field should be placed (requires documents be PDF files). - When the page number parameter is supplied, the API will use the new coordinate system. - Check out the differences between both [coordinate systems](https://faq.hellosign.com/hc/en-us/articles/217115577) and how to use them.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'SubFormFieldsPerDocumentCheckbox','checkbox-merge': 'SubFormFieldsPerDocumentCheckboxMerge','date_signed': 'SubFormFieldsPerDocumentDateSigned','dropdown': 'SubFormFieldsPerDocumentDropdown','hyperlink': 'SubFormFieldsPerDocumentHyperlink','initials': 'SubFormFieldsPerDocumentInitials','radio': 'SubFormFieldsPerDocumentRadio','signature': 'SubFormFieldsPerDocumentSignature','text': 'SubFormFieldsPerDocumentText','text-merge': 'SubFormFieldsPerDocumentTextMerge' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge]]: + """Create an instance of SubFormFieldsPerDocumentBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[SubFormFieldsPerDocumentCheckbox, SubFormFieldsPerDocumentCheckboxMerge, SubFormFieldsPerDocumentDateSigned, SubFormFieldsPerDocumentDropdown, SubFormFieldsPerDocumentHyperlink, SubFormFieldsPerDocumentInitials, SubFormFieldsPerDocumentRadio, SubFormFieldsPerDocumentSignature, SubFormFieldsPerDocumentText, SubFormFieldsPerDocumentTextMerge]]: + """Create an instance of SubFormFieldsPerDocumentBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'SubFormFieldsPerDocumentCheckbox': + return import_module("dropbox_sign.models.sub_form_fields_per_document_checkbox").SubFormFieldsPerDocumentCheckbox.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentCheckboxMerge': + return import_module("dropbox_sign.models.sub_form_fields_per_document_checkbox_merge").SubFormFieldsPerDocumentCheckboxMerge.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentDateSigned': + return import_module("dropbox_sign.models.sub_form_fields_per_document_date_signed").SubFormFieldsPerDocumentDateSigned.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentDropdown': + return import_module("dropbox_sign.models.sub_form_fields_per_document_dropdown").SubFormFieldsPerDocumentDropdown.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentHyperlink': + return import_module("dropbox_sign.models.sub_form_fields_per_document_hyperlink").SubFormFieldsPerDocumentHyperlink.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentInitials': + return import_module("dropbox_sign.models.sub_form_fields_per_document_initials").SubFormFieldsPerDocumentInitials.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentRadio': + return import_module("dropbox_sign.models.sub_form_fields_per_document_radio").SubFormFieldsPerDocumentRadio.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentSignature': + return import_module("dropbox_sign.models.sub_form_fields_per_document_signature").SubFormFieldsPerDocumentSignature.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentText': + return import_module("dropbox_sign.models.sub_form_fields_per_document_text").SubFormFieldsPerDocumentText.from_dict(obj) + if object_type == 'SubFormFieldsPerDocumentTextMerge': + return import_module("dropbox_sign.models.sub_form_fields_per_document_text_merge").SubFormFieldsPerDocumentTextMerge.from_dict(obj) + + raise ValueError("SubFormFieldsPerDocumentBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "type": "(str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_checkbox.py b/dropbox_sign/models/sub_form_fields_per_document_checkbox.py new file mode 100644 index 0000000..b134fd0 --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_checkbox.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentCheckbox(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class.") + is_checked: StrictBool = Field(description="`true` for checking the checkbox field by default, otherwise `false`.") + group: Optional[StrictStr] = Field(default=None, description="String referencing group defined in `form_field_groups` parameter.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "is_checked", "name", "page", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentCheckbox from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "is_checked": obj.get("is_checked"), + "name": obj.get("name"), + "page": obj.get("page"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "is_checked": "(bool,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "group": "(str,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_checkbox_merge.py b/dropbox_sign/models/sub_form_fields_per_document_checkbox_merge.py new file mode 100644 index 0000000..f63525f --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_checkbox_merge.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentCheckboxMerge(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentCheckboxMerge from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentCheckboxMerge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'checkbox-merge', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_date_signed.py b/dropbox_sign/models/sub_form_fields_per_document_date_signed.py new file mode 100644 index 0000000..291c4ef --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_date_signed.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentDateSigned(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A date. Use the `SubFormFieldsPerDocumentDateSigned` class.") + font_family: Optional[StrictStr] = Field(default=None, description="Font family for the field.") + font_size: Optional[StrictInt] = Field(default=12, description="The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page", "font_family", "font_size"] + + @field_validator('font_family') + def font_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged']): + raise ValueError("must be one of enum values ('helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentDateSigned from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentDateSigned from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'date_signed', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page"), + "font_family": obj.get("font_family"), + "font_size": obj.get("font_size") if obj.get("font_size") is not None else 12 + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "font_family": "(str,)", + "font_size": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_dropdown.py b/dropbox_sign/models/sub_form_fields_per_document_dropdown.py new file mode 100644 index 0000000..7a1d384 --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_dropdown.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentDropdown(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class.") + options: Annotated[List[StrictStr], Field(min_length=1)] = Field(description="Array of string values representing dropdown values.") + content: Optional[StrictStr] = Field(default=None, description="Selected value in `options` array. Value must exist in array.") + font_family: Optional[StrictStr] = Field(default=None, description="Font family for the field.") + font_size: Optional[StrictInt] = Field(default=12, description="The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "options", "name", "page", "content", "font_family", "font_size"] + + @field_validator('font_family') + def font_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged']): + raise ValueError("must be one of enum values ('helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentDropdown from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentDropdown from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'dropdown', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "options": obj.get("options"), + "name": obj.get("name"), + "page": obj.get("page"), + "content": obj.get("content"), + "font_family": obj.get("font_family"), + "font_size": obj.get("font_size") if obj.get("font_size") is not None else 12 + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "options": "(List[str],)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "content": "(str,)", + "font_family": "(str,)", + "font_size": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "options", + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_font_enum.py b/dropbox_sign/models/sub_form_fields_per_document_font_enum.py new file mode 100644 index 0000000..3b95a6b --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_font_enum.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SubFormFieldsPerDocumentFontEnum(str, Enum): + """ + SubFormFieldsPerDocumentFontEnum + """ + + """ + allowed enum values + """ + HELVETICA = 'helvetica' + ARIAL = 'arial' + COURIER = 'courier' + CALIBRI = 'calibri' + CAMBRIA = 'cambria' + GEORGIA = 'georgia' + TIMES = 'times' + TREBUCHET = 'trebuchet' + VERDANA = 'verdana' + ROBOTO = 'roboto' + ROBOTOMONO = 'robotoMono' + NOTOSANS = 'notoSans' + NOTOSERIF = 'notoSerif' + NOTO_CJK_MINUS_JP_MINUS_REGULAR = 'notoCJK-JP-Regular' + NOTO_HEBREW_MINUS_REGULAR = 'notoHebrew-Regular' + NOTOSANTHAIMERGED = 'notoSanThaiMerged' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SubFormFieldsPerDocumentFontEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dropbox_sign/models/sub_form_fields_per_document_hyperlink.py b/dropbox_sign/models/sub_form_fields_per_document_hyperlink.py new file mode 100644 index 0000000..9526b36 --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_hyperlink.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentHyperlink(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class.") + content: StrictStr = Field(description="Link Text.") + content_url: StrictStr = Field(description="Link URL.") + font_family: Optional[StrictStr] = Field(default=None, description="Font family for the field.") + font_size: Optional[StrictInt] = Field(default=12, description="The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "content", "content_url", "name", "page", "font_family", "font_size"] + + @field_validator('font_family') + def font_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged']): + raise ValueError("must be one of enum values ('helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentHyperlink from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentHyperlink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'hyperlink', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "content": obj.get("content"), + "content_url": obj.get("content_url"), + "name": obj.get("name"), + "page": obj.get("page"), + "font_family": obj.get("font_family"), + "font_size": obj.get("font_size") if obj.get("font_size") is not None else 12 + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "content": "(str,)", + "content_url": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "font_family": "(str,)", + "font_size": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_initials.py b/dropbox_sign/models/sub_form_fields_per_document_initials.py new file mode 100644 index 0000000..45b2f19 --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_initials.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentInitials(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentInitials from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentInitials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'initials', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_radio.py b/dropbox_sign/models/sub_form_fields_per_document_radio.py new file mode 100644 index 0000000..a40731c --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_radio.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentRadio(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class.") + group: StrictStr = Field(description="String referencing group defined in `form_field_groups` parameter.") + is_checked: StrictBool = Field(description="`true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "group", "is_checked", "name", "page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentRadio from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentRadio from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'radio', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "group": obj.get("group"), + "is_checked": obj.get("is_checked"), + "name": obj.get("name"), + "page": obj.get("page") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "group": "(str,)", + "is_checked": "(bool,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_signature.py b/dropbox_sign/models/sub_form_fields_per_document_signature.py new file mode 100644 index 0000000..8680669 --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_signature.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentSignature(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A signature input field. Use the `SubFormFieldsPerDocumentSignature` class.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentSignature from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentSignature from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'signature', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_text.py b/dropbox_sign/models/sub_form_fields_per_document_text.py new file mode 100644 index 0000000..7e569bc --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_text.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentText(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A text input field. Use the `SubFormFieldsPerDocumentText` class.") + placeholder: Optional[StrictStr] = Field(default=None, description="Placeholder value for text field.") + auto_fill_type: Optional[StrictStr] = Field(default=None, description="Auto fill type for populating fields automatically. Check out the list of [auto fill types](/api/reference/constants/#auto-fill-types) to learn more about the possible values.") + link_id: Optional[StrictStr] = Field(default=None, description="Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields.") + masked: Optional[StrictBool] = Field(default=None, description="Masks entered data. For more information see [Masking sensitive information](https://faq.hellosign.com/hc/en-us/articles/360040742811-Masking-sensitive-information). `true` for masking the data in a text field, otherwise `false`.") + validation_type: Optional[StrictStr] = Field(default=None, description="Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. **NOTE:** When using `custom_regex` you are required to pass a second parameter `validation_custom_regex` and you can optionally provide `validation_custom_regex_format_label` for the error message the user will see in case of an invalid value.") + validation_custom_regex: Optional[StrictStr] = None + validation_custom_regex_format_label: Optional[StrictStr] = None + content: Optional[StrictStr] = Field(default=None, description="Content of a `me_now` text field") + font_family: Optional[StrictStr] = Field(default=None, description="Font family for the field.") + font_size: Optional[StrictInt] = Field(default=12, description="The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page", "placeholder", "auto_fill_type", "link_id", "masked", "validation_type", "validation_custom_regex", "validation_custom_regex_format_label", "content", "font_family", "font_size"] + + @field_validator('validation_type') + def validation_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['numbers_only', 'letters_only', 'phone_number', 'bank_routing_number', 'bank_account_number', 'email_address', 'zip_code', 'social_security_number', 'employer_identification_number', 'custom_regex']): + raise ValueError("must be one of enum values ('numbers_only', 'letters_only', 'phone_number', 'bank_routing_number', 'bank_account_number', 'email_address', 'zip_code', 'social_security_number', 'employer_identification_number', 'custom_regex')") + return value + + @field_validator('font_family') + def font_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged']): + raise ValueError("must be one of enum values ('helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentText from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'text', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page"), + "placeholder": obj.get("placeholder"), + "auto_fill_type": obj.get("auto_fill_type"), + "link_id": obj.get("link_id"), + "masked": obj.get("masked"), + "validation_type": obj.get("validation_type"), + "validation_custom_regex": obj.get("validation_custom_regex"), + "validation_custom_regex_format_label": obj.get("validation_custom_regex_format_label"), + "content": obj.get("content"), + "font_family": obj.get("font_family"), + "font_size": obj.get("font_size") if obj.get("font_size") is not None else 12 + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "placeholder": "(str,)", + "auto_fill_type": "(str,)", + "link_id": "(str,)", + "masked": "(bool,)", + "validation_type": "(str,)", + "validation_custom_regex": "(str,)", + "validation_custom_regex_format_label": "(str,)", + "content": "(str,)", + "font_family": "(str,)", + "font_size": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_text_merge.py b/dropbox_sign/models/sub_form_fields_per_document_text_merge.py new file mode 100644 index 0000000..a60f04b --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_text_merge.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubFormFieldsPerDocumentTextMerge(SubFormFieldsPerDocumentBase): + """ + This class extends `SubFormFieldsPerDocumentBase`. + """ # noqa: E501 + type: StrictStr = Field(description="A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class.") + font_family: Optional[StrictStr] = Field(default=None, description="Font family for the field.") + font_size: Optional[StrictInt] = Field(default=12, description="The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE:** Font size may be reduced during processing in order to fit the contents within the dimensions of the field.") + __properties: ClassVar[List[str]] = ["document_index", "api_id", "height", "required", "signer", "type", "width", "x", "y", "name", "page", "font_family", "font_size"] + + @field_validator('font_family') + def font_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged']): + raise ValueError("must be one of enum values ('helvetica', 'arial', 'courier', 'calibri', 'cambria', 'georgia', 'times', 'trebuchet', 'verdana', 'roboto', 'robotoMono', 'notoSans', 'notoSerif', 'notoCJK-JP-Regular', 'notoHebrew-Regular', 'notoSanThaiMerged')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentTextMerge from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubFormFieldsPerDocumentTextMerge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_index": obj.get("document_index"), + "api_id": obj.get("api_id"), + "height": obj.get("height"), + "required": obj.get("required"), + "signer": obj.get("signer"), + "type": obj.get("type") if obj.get("type") is not None else 'text-merge', + "width": obj.get("width"), + "x": obj.get("x"), + "y": obj.get("y"), + "name": obj.get("name"), + "page": obj.get("page"), + "font_family": obj.get("font_family"), + "font_size": obj.get("font_size") if obj.get("font_size") is not None else 12 + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "document_index": "(int,)", + "api_id": "(str,)", + "height": "(int,)", + "required": "(bool,)", + "signer": "(int, str,)", + "width": "(int,)", + "x": "(int,)", + "y": "(int,)", + "font_family": "(str,)", + "font_size": "(int,)", + "name": "(str,)", + "page": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_form_fields_per_document_type_enum.py b/dropbox_sign/models/sub_form_fields_per_document_type_enum.py new file mode 100644 index 0000000..3ad73f8 --- /dev/null +++ b/dropbox_sign/models/sub_form_fields_per_document_type_enum.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SubFormFieldsPerDocumentTypeEnum(str, Enum): + """ + SubFormFieldsPerDocumentTypeEnum + """ + + """ + allowed enum values + """ + CHECKBOX = 'checkbox' + CHECKBOX_MINUS_MERGE = 'checkbox-merge' + DATE_SIGNED = 'date_signed' + DROPDOWN = 'dropdown' + HYPERLINK = 'hyperlink' + INITIALS = 'initials' + SIGNATURE = 'signature' + RADIO = 'radio' + TEXT = 'text' + TEXT_MINUS_MERGE = 'text-merge' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SubFormFieldsPerDocumentTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/dropbox_sign/models/sub_merge_field.py b/dropbox_sign/models/sub_merge_field.py new file mode 100644 index 0000000..9e24d55 --- /dev/null +++ b/dropbox_sign/models/sub_merge_field.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubMergeField(BaseModel): + """ + SubMergeField + """ # noqa: E501 + name: StrictStr = Field(description="The name of the merge field. Must be unique.") + type: StrictStr = Field(description="The type of merge field.") + __properties: ClassVar[List[str]] = ["name", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['text', 'checkbox']): + raise ValueError("must be one of enum values ('text', 'checkbox')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubMergeField from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubMergeField from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "type": obj.get("type") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + "type": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_o_auth.py b/dropbox_sign/models/sub_o_auth.py new file mode 100644 index 0000000..d386018 --- /dev/null +++ b/dropbox_sign/models/sub_o_auth.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubOAuth(BaseModel): + """ + OAuth related parameters. + """ # noqa: E501 + callback_url: Optional[StrictStr] = Field(default=None, description="The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided)") + scopes: Optional[List[StrictStr]] = Field(default=None, description="A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided).") + __properties: ClassVar[List[str]] = ["callback_url", "scopes"] + + @field_validator('scopes') + def scopes_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['request_signature', 'basic_account_info', 'account_access', 'signature_request_access', 'template_access', 'team_access', 'api_app_access', '']): + raise ValueError("each list item must be one of ('request_signature', 'basic_account_info', 'account_access', 'signature_request_access', 'template_access', 'team_access', 'api_app_access', '')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubOAuth from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubOAuth from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callback_url": obj.get("callback_url"), + "scopes": obj.get("scopes") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "callback_url": "(str,)", + "scopes": "(List[str],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "scopes", + ] + diff --git a/dropbox_sign/models/sub_options.py b/dropbox_sign/models/sub_options.py new file mode 100644 index 0000000..1f80f2a --- /dev/null +++ b/dropbox_sign/models/sub_options.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubOptions(BaseModel): + """ + Additional options supported by API App. + """ # noqa: E501 + can_insert_everywhere: Optional[StrictBool] = Field(default=False, description="Determines if signers can use \"Insert Everywhere\" when signing a document.") + __properties: ClassVar[List[str]] = ["can_insert_everywhere"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "can_insert_everywhere": obj.get("can_insert_everywhere") if obj.get("can_insert_everywhere") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "can_insert_everywhere": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_signature_request_grouped_signers.py b/dropbox_sign/models/sub_signature_request_grouped_signers.py new file mode 100644 index 0000000..b0734b9 --- /dev/null +++ b/dropbox_sign/models/sub_signature_request_grouped_signers.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_signature_request_signer import SubSignatureRequestSigner +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubSignatureRequestGroupedSigners(BaseModel): + """ + SubSignatureRequestGroupedSigners + """ # noqa: E501 + group: StrictStr = Field(description="The name of the group.") + signers: List[SubSignatureRequestSigner] = Field(description="Signers belonging to this Group. **NOTE:** Only `name`, `email_address`, and `pin` are available to Grouped Signers. We will ignore all other properties, even though they are listed below.") + order: Optional[StrictInt] = Field(default=None, description="The order the group is required to sign in. Use this instead of Signer-level `order`.") + __properties: ClassVar[List[str]] = ["group", "signers", "order"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubSignatureRequestGroupedSigners from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubSignatureRequestGroupedSigners from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "group": obj.get("group"), + "signers": [SubSignatureRequestSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "order": obj.get("order") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "group": "(str,)", + "signers": "(List[SubSignatureRequestSigner],)", + "order": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "signers", + ] + diff --git a/dropbox_sign/models/sub_signature_request_signer.py b/dropbox_sign/models/sub_signature_request_signer.py new file mode 100644 index 0000000..ff4091a --- /dev/null +++ b/dropbox_sign/models/sub_signature_request_signer.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubSignatureRequestSigner(BaseModel): + """ + SubSignatureRequestSigner + """ # noqa: E501 + name: StrictStr = Field(description="The name of the signer.") + email_address: StrictStr = Field(description="The email address of the signer.") + order: Optional[StrictInt] = Field(default=None, description="The order the signer is required to sign in.") + pin: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=12)]] = Field(default=None, description="The 4- to 12-character access code that will secure this signer's signature page.") + sms_phone_number: Optional[StrictStr] = Field(default=None, description="An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.") + sms_phone_number_type: Optional[StrictStr] = Field(default=None, description="Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).") + __properties: ClassVar[List[str]] = ["name", "email_address", "order", "pin", "sms_phone_number", "sms_phone_number_type"] + + @field_validator('sms_phone_number_type') + def sms_phone_number_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['authentication', 'delivery']): + raise ValueError("must be one of enum values ('authentication', 'delivery')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubSignatureRequestSigner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubSignatureRequestSigner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "email_address": obj.get("email_address"), + "order": obj.get("order"), + "pin": obj.get("pin"), + "sms_phone_number": obj.get("sms_phone_number"), + "sms_phone_number_type": obj.get("sms_phone_number_type") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + "email_address": "(str,)", + "order": "(int,)", + "pin": "(str,)", + "sms_phone_number": "(str,)", + "sms_phone_number_type": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_signature_request_template_signer.py b/dropbox_sign/models/sub_signature_request_template_signer.py new file mode 100644 index 0000000..d5affd2 --- /dev/null +++ b/dropbox_sign/models/sub_signature_request_template_signer.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubSignatureRequestTemplateSigner(BaseModel): + """ + SubSignatureRequestTemplateSigner + """ # noqa: E501 + role: StrictStr = Field(description="Must match an existing role in chosen Template(s). It's case-sensitive.") + name: StrictStr = Field(description="The name of the signer.") + email_address: StrictStr = Field(description="The email address of the signer.") + pin: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=12)]] = Field(default=None, description="The 4- to 12-character access code that will secure this signer's signature page.") + sms_phone_number: Optional[StrictStr] = Field(default=None, description="An E.164 formatted phone number. By using the feature, you agree you are responsible for obtaining a signer's consent to receive text messages from Dropbox Sign related to this signature request and confirm you have obtained such consent from all signers prior to enabling SMS delivery for this signature request. [Learn more](https://faq.hellosign.com/hc/en-us/articles/15815316468877-Dropbox-Sign-SMS-tools-add-on). **NOTE:** Not available in test mode and requires a Standard plan or higher.") + sms_phone_number_type: Optional[StrictStr] = Field(default=None, description="Specifies the feature used with the `sms_phone_number`. Default `authentication`. If `authentication`, signer is sent a verification code via SMS that is required to access the document. If `delivery`, a link to complete the signature request is delivered via SMS (_and_ email).") + __properties: ClassVar[List[str]] = ["role", "name", "email_address", "pin", "sms_phone_number", "sms_phone_number_type"] + + @field_validator('sms_phone_number_type') + def sms_phone_number_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['authentication', 'delivery']): + raise ValueError("must be one of enum values ('authentication', 'delivery')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubSignatureRequestTemplateSigner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubSignatureRequestTemplateSigner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "role": obj.get("role"), + "name": obj.get("name"), + "email_address": obj.get("email_address"), + "pin": obj.get("pin"), + "sms_phone_number": obj.get("sms_phone_number"), + "sms_phone_number_type": obj.get("sms_phone_number_type") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "role": "(str,)", + "name": "(str,)", + "email_address": "(str,)", + "pin": "(str,)", + "sms_phone_number": "(str,)", + "sms_phone_number_type": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_signing_options.py b/dropbox_sign/models/sub_signing_options.py new file mode 100644 index 0000000..eec7baf --- /dev/null +++ b/dropbox_sign/models/sub_signing_options.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubSigningOptions(BaseModel): + """ + This allows the requester to specify the types allowed for creating a signature. **NOTE:** If `signing_options` are not defined in the request, the allowed types will default to those specified in the account settings. + """ # noqa: E501 + default_type: StrictStr = Field(description="The default type shown (limited to the listed types)") + draw: Optional[StrictBool] = Field(default=False, description="Allows drawing the signature") + phone: Optional[StrictBool] = Field(default=False, description="Allows using a smartphone to email the signature") + type: Optional[StrictBool] = Field(default=False, description="Allows typing the signature") + upload: Optional[StrictBool] = Field(default=False, description="Allows uploading the signature") + __properties: ClassVar[List[str]] = ["default_type", "draw", "phone", "type", "upload"] + + @field_validator('default_type') + def default_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['draw', 'phone', 'type', 'upload']): + raise ValueError("must be one of enum values ('draw', 'phone', 'type', 'upload')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubSigningOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubSigningOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "default_type": obj.get("default_type"), + "draw": obj.get("draw") if obj.get("draw") is not None else False, + "phone": obj.get("phone") if obj.get("phone") is not None else False, + "type": obj.get("type") if obj.get("type") is not None else False, + "upload": obj.get("upload") if obj.get("upload") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "default_type": "(str,)", + "draw": "(bool,)", + "phone": "(bool,)", + "type": "(bool,)", + "upload": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_team_response.py b/dropbox_sign/models/sub_team_response.py new file mode 100644 index 0000000..8cd9ad5 --- /dev/null +++ b/dropbox_sign/models/sub_team_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubTeamResponse(BaseModel): + """ + SubTeamResponse + """ # noqa: E501 + team_id: Optional[StrictStr] = Field(default=None, description="The id of a team") + name: Optional[StrictStr] = Field(default=None, description="The name of a team") + __properties: ClassVar[List[str]] = ["team_id", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubTeamResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubTeamResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team_id": obj.get("team_id"), + "name": obj.get("name") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "team_id": "(str,)", + "name": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_template_role.py b/dropbox_sign/models/sub_template_role.py new file mode 100644 index 0000000..95eda37 --- /dev/null +++ b/dropbox_sign/models/sub_template_role.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubTemplateRole(BaseModel): + """ + SubTemplateRole + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The role name of the signer that will be displayed when the template is used to create a signature request.") + order: Optional[StrictInt] = Field(default=None, description="The order in which this signer role is required to sign.") + __properties: ClassVar[List[str]] = ["name", "order"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubTemplateRole from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubTemplateRole from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "order": obj.get("order") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + "order": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_unclaimed_draft_signer.py b/dropbox_sign/models/sub_unclaimed_draft_signer.py new file mode 100644 index 0000000..9f705a0 --- /dev/null +++ b/dropbox_sign/models/sub_unclaimed_draft_signer.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubUnclaimedDraftSigner(BaseModel): + """ + SubUnclaimedDraftSigner + """ # noqa: E501 + email_address: StrictStr = Field(description="The email address of the signer.") + name: StrictStr = Field(description="The name of the signer.") + order: Optional[StrictInt] = Field(default=None, description="The order the signer is required to sign in.") + __properties: ClassVar[List[str]] = ["email_address", "name", "order"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubUnclaimedDraftSigner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubUnclaimedDraftSigner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address"), + "name": obj.get("name"), + "order": obj.get("order") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "email_address": "(str,)", + "name": "(str,)", + "order": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_unclaimed_draft_template_signer.py b/dropbox_sign/models/sub_unclaimed_draft_template_signer.py new file mode 100644 index 0000000..fbe7760 --- /dev/null +++ b/dropbox_sign/models/sub_unclaimed_draft_template_signer.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubUnclaimedDraftTemplateSigner(BaseModel): + """ + SubUnclaimedDraftTemplateSigner + """ # noqa: E501 + role: StrictStr = Field(description="Must match an existing role in chosen Template(s).") + name: StrictStr = Field(description="The name of the signer filling the role of `role`.") + email_address: StrictStr = Field(description="The email address of the signer filling the role of `role`.") + __properties: ClassVar[List[str]] = ["role", "name", "email_address"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubUnclaimedDraftTemplateSigner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubUnclaimedDraftTemplateSigner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "role": obj.get("role"), + "name": obj.get("name"), + "email_address": obj.get("email_address") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "role": "(str,)", + "name": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/sub_white_labeling_options.py b/dropbox_sign/models/sub_white_labeling_options.py new file mode 100644 index 0000000..d6e7226 --- /dev/null +++ b/dropbox_sign/models/sub_white_labeling_options.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class SubWhiteLabelingOptions(BaseModel): + """ + An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more. + """ # noqa: E501 + header_background_color: Optional[StrictStr] = '#1A1A1A' + legal_version: Optional[StrictStr] = 'terms1' + link_color: Optional[StrictStr] = '#00B3E6' + page_background_color: Optional[StrictStr] = '#F7F8F9' + primary_button_color: Optional[StrictStr] = '#00B3E6' + primary_button_color_hover: Optional[StrictStr] = '#00B3E6' + primary_button_text_color: Optional[StrictStr] = '#FFFFFF' + primary_button_text_color_hover: Optional[StrictStr] = '#FFFFFF' + secondary_button_color: Optional[StrictStr] = '#FFFFFF' + secondary_button_color_hover: Optional[StrictStr] = '#FFFFFF' + secondary_button_text_color: Optional[StrictStr] = '#00B3E6' + secondary_button_text_color_hover: Optional[StrictStr] = '#00B3E6' + text_color1: Optional[StrictStr] = '#808080' + text_color2: Optional[StrictStr] = '#FFFFFF' + reset_to_default: Optional[StrictBool] = Field(default=None, description="Resets white labeling options to defaults. Only useful when updating an API App.") + __properties: ClassVar[List[str]] = ["header_background_color", "legal_version", "link_color", "page_background_color", "primary_button_color", "primary_button_color_hover", "primary_button_text_color", "primary_button_text_color_hover", "secondary_button_color", "secondary_button_color_hover", "secondary_button_text_color", "secondary_button_text_color_hover", "text_color1", "text_color2", "reset_to_default"] + + @field_validator('legal_version') + def legal_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['terms1', 'terms2']): + raise ValueError("must be one of enum values ('terms1', 'terms2')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubWhiteLabelingOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubWhiteLabelingOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "header_background_color": obj.get("header_background_color") if obj.get("header_background_color") is not None else '#1A1A1A', + "legal_version": obj.get("legal_version") if obj.get("legal_version") is not None else 'terms1', + "link_color": obj.get("link_color") if obj.get("link_color") is not None else '#00B3E6', + "page_background_color": obj.get("page_background_color") if obj.get("page_background_color") is not None else '#F7F8F9', + "primary_button_color": obj.get("primary_button_color") if obj.get("primary_button_color") is not None else '#00B3E6', + "primary_button_color_hover": obj.get("primary_button_color_hover") if obj.get("primary_button_color_hover") is not None else '#00B3E6', + "primary_button_text_color": obj.get("primary_button_text_color") if obj.get("primary_button_text_color") is not None else '#FFFFFF', + "primary_button_text_color_hover": obj.get("primary_button_text_color_hover") if obj.get("primary_button_text_color_hover") is not None else '#FFFFFF', + "secondary_button_color": obj.get("secondary_button_color") if obj.get("secondary_button_color") is not None else '#FFFFFF', + "secondary_button_color_hover": obj.get("secondary_button_color_hover") if obj.get("secondary_button_color_hover") is not None else '#FFFFFF', + "secondary_button_text_color": obj.get("secondary_button_text_color") if obj.get("secondary_button_text_color") is not None else '#00B3E6', + "secondary_button_text_color_hover": obj.get("secondary_button_text_color_hover") if obj.get("secondary_button_text_color_hover") is not None else '#00B3E6', + "text_color1": obj.get("text_color1") if obj.get("text_color1") is not None else '#808080', + "text_color2": obj.get("text_color2") if obj.get("text_color2") is not None else '#FFFFFF', + "reset_to_default": obj.get("reset_to_default") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "header_background_color": "(str,)", + "legal_version": "(str,)", + "link_color": "(str,)", + "page_background_color": "(str,)", + "primary_button_color": "(str,)", + "primary_button_color_hover": "(str,)", + "primary_button_text_color": "(str,)", + "primary_button_text_color_hover": "(str,)", + "secondary_button_color": "(str,)", + "secondary_button_color_hover": "(str,)", + "secondary_button_text_color": "(str,)", + "secondary_button_text_color_hover": "(str,)", + "text_color1": "(str,)", + "text_color2": "(str,)", + "reset_to_default": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/team_add_member_request.py b/dropbox_sign/models/team_add_member_request.py new file mode 100644 index 0000000..3358304 --- /dev/null +++ b/dropbox_sign/models/team_add_member_request.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamAddMemberRequest(BaseModel): + """ + TeamAddMemberRequest + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="`account_id` or `email_address` is required. If both are provided, the account id prevails. Account id of the user to invite to your Team.") + email_address: Optional[StrictStr] = Field(default=None, description="`account_id` or `email_address` is required, If both are provided, the account id prevails. Email address of the user to invite to your Team.") + role: Optional[StrictStr] = Field(default=None, description="A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided.") + __properties: ClassVar[List[str]] = ["account_id", "email_address", "role"] + + @field_validator('role') + def role_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Member', 'Developer', 'Team Manager', 'Admin']): + raise ValueError("must be one of enum values ('Member', 'Developer', 'Team Manager', 'Admin')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamAddMemberRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamAddMemberRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "role": obj.get("role") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account_id": "(str,)", + "email_address": "(str,)", + "role": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/team_create_request.py b/dropbox_sign/models/team_create_request.py new file mode 100644 index 0000000..6ffdbbe --- /dev/null +++ b/dropbox_sign/models/team_create_request.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamCreateRequest(BaseModel): + """ + TeamCreateRequest + """ # noqa: E501 + name: Optional[StrictStr] = Field(default='Untitled Team', description="The name of your Team.") + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamCreateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") if obj.get("name") is not None else 'Untitled Team' + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/team_get_info_response.py b/dropbox_sign/models/team_get_info_response.py new file mode 100644 index 0000000..553e038 --- /dev/null +++ b/dropbox_sign/models/team_get_info_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.team_info_response import TeamInfoResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamGetInfoResponse(BaseModel): + """ + TeamGetInfoResponse + """ # noqa: E501 + team: TeamInfoResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["team", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamGetInfoResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of team + if self.team: + _dict['team'] = self.team.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamGetInfoResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team": TeamInfoResponse.from_dict(obj["team"]) if obj.get("team") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "team": "(TeamInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/team_get_response.py b/dropbox_sign/models/team_get_response.py new file mode 100644 index 0000000..fcb6fb9 --- /dev/null +++ b/dropbox_sign/models/team_get_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.team_response import TeamResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamGetResponse(BaseModel): + """ + TeamGetResponse + """ # noqa: E501 + team: TeamResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["team", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamGetResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of team + if self.team: + _dict['team'] = self.team.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team": TeamResponse.from_dict(obj["team"]) if obj.get("team") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "team": "(TeamResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/team_info_response.py b/dropbox_sign/models/team_info_response.py new file mode 100644 index 0000000..533d3eb --- /dev/null +++ b/dropbox_sign/models/team_info_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.team_parent_response import TeamParentResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamInfoResponse(BaseModel): + """ + TeamInfoResponse + """ # noqa: E501 + team_id: Optional[StrictStr] = Field(default=None, description="The id of a team") + team_parent: Optional[TeamParentResponse] = None + name: Optional[StrictStr] = Field(default=None, description="The name of a team") + num_members: Optional[StrictInt] = Field(default=None, description="Number of members within a team") + num_sub_teams: Optional[StrictInt] = Field(default=None, description="Number of sub teams within a team") + __properties: ClassVar[List[str]] = ["team_id", "team_parent", "name", "num_members", "num_sub_teams"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamInfoResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of team_parent + if self.team_parent: + _dict['team_parent'] = self.team_parent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamInfoResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team_id": obj.get("team_id"), + "team_parent": TeamParentResponse.from_dict(obj["team_parent"]) if obj.get("team_parent") is not None else None, + "name": obj.get("name"), + "num_members": obj.get("num_members"), + "num_sub_teams": obj.get("num_sub_teams") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "team_id": "(str,)", + "team_parent": "(TeamParentResponse,)", + "name": "(str,)", + "num_members": "(int,)", + "num_sub_teams": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/team_invite_response.py b/dropbox_sign/models/team_invite_response.py new file mode 100644 index 0000000..5a5068b --- /dev/null +++ b/dropbox_sign/models/team_invite_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamInviteResponse(BaseModel): + """ + TeamInviteResponse + """ # noqa: E501 + email_address: Optional[StrictStr] = Field(default=None, description="Email address of the user invited to this team.") + team_id: Optional[StrictStr] = Field(default=None, description="Id of the team.") + role: Optional[StrictStr] = Field(default=None, description="Role of the user invited to this team.") + sent_at: Optional[StrictInt] = Field(default=None, description="Timestamp when the invitation was sent.") + redeemed_at: Optional[StrictInt] = Field(default=None, description="Timestamp when the invitation was redeemed.") + expires_at: Optional[StrictInt] = Field(default=None, description="Timestamp when the invitation is expiring.") + __properties: ClassVar[List[str]] = ["email_address", "team_id", "role", "sent_at", "redeemed_at", "expires_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamInviteResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamInviteResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_address": obj.get("email_address"), + "team_id": obj.get("team_id"), + "role": obj.get("role"), + "sent_at": obj.get("sent_at"), + "redeemed_at": obj.get("redeemed_at"), + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "email_address": "(str,)", + "team_id": "(str,)", + "role": "(str,)", + "sent_at": "(int,)", + "redeemed_at": "(int,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/team_invites_response.py b/dropbox_sign/models/team_invites_response.py new file mode 100644 index 0000000..e54721b --- /dev/null +++ b/dropbox_sign/models/team_invites_response.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.team_invite_response import TeamInviteResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamInvitesResponse(BaseModel): + """ + TeamInvitesResponse + """ # noqa: E501 + team_invites: List[TeamInviteResponse] = Field(description="Contains a list of team invites and their roles.") + warnings: Optional[List[WarningResponse]] = None + __properties: ClassVar[List[str]] = ["team_invites", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamInvitesResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in team_invites (list) + _items = [] + if self.team_invites: + for _item_team_invites in self.team_invites: + if _item_team_invites: + _items.append(_item_team_invites.to_dict()) + _dict['team_invites'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamInvitesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team_invites": [TeamInviteResponse.from_dict(_item) for _item in obj["team_invites"]] if obj.get("team_invites") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "team_invites": "(List[TeamInviteResponse],)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "team_invites", + "warnings", + ] + diff --git a/dropbox_sign/models/team_member_response.py b/dropbox_sign/models/team_member_response.py new file mode 100644 index 0000000..d880c3c --- /dev/null +++ b/dropbox_sign/models/team_member_response.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamMemberResponse(BaseModel): + """ + TeamMemberResponse + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="Account id of the team member.") + email_address: Optional[StrictStr] = Field(default=None, description="Email address of the team member.") + role: Optional[StrictStr] = Field(default=None, description="The specific role a member has on the team.") + __properties: ClassVar[List[str]] = ["account_id", "email_address", "role"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamMemberResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamMemberResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "role": obj.get("role") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account_id": "(str,)", + "email_address": "(str,)", + "role": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/team_members_response.py b/dropbox_sign/models/team_members_response.py new file mode 100644 index 0000000..5ad4aaa --- /dev/null +++ b/dropbox_sign/models/team_members_response.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.team_member_response import TeamMemberResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamMembersResponse(BaseModel): + """ + TeamMembersResponse + """ # noqa: E501 + team_members: List[TeamMemberResponse] = Field(description="Contains a list of team members and their roles for a specific team.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = None + __properties: ClassVar[List[str]] = ["team_members", "list_info", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamMembersResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in team_members (list) + _items = [] + if self.team_members: + for _item_team_members in self.team_members: + if _item_team_members: + _items.append(_item_team_members.to_dict()) + _dict['team_members'] = _items + # override the default output from pydantic by calling `to_dict()` of list_info + if self.list_info: + _dict['list_info'] = self.list_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamMembersResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team_members": [TeamMemberResponse.from_dict(_item) for _item in obj["team_members"]] if obj.get("team_members") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "team_members": "(List[TeamMemberResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "team_members", + "warnings", + ] + diff --git a/dropbox_sign/models/team_parent_response.py b/dropbox_sign/models/team_parent_response.py new file mode 100644 index 0000000..35cc1c0 --- /dev/null +++ b/dropbox_sign/models/team_parent_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamParentResponse(BaseModel): + """ + Information about the parent team if a team has one, set to `null` otherwise. + """ # noqa: E501 + team_id: Optional[StrictStr] = Field(default=None, description="The id of a team") + name: Optional[StrictStr] = Field(default=None, description="The name of a team") + __properties: ClassVar[List[str]] = ["team_id", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamParentResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamParentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "team_id": obj.get("team_id"), + "name": obj.get("name") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "team_id": "(str,)", + "name": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/team_remove_member_request.py b/dropbox_sign/models/team_remove_member_request.py new file mode 100644 index 0000000..c1470da --- /dev/null +++ b/dropbox_sign/models/team_remove_member_request.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamRemoveMemberRequest(BaseModel): + """ + TeamRemoveMemberRequest + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="**account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team.") + email_address: Optional[StrictStr] = Field(default=None, description="**account_id** or **email_address** is required. If both are provided, the account id prevails. Email address of the Account to remove from your Team.") + new_owner_email_address: Optional[StrictStr] = Field(default=None, description="The email address of an Account on this Team to receive all documents, templates, and API apps (if applicable) from the removed Account. If not provided, and on an Enterprise plan, this data will remain with the removed Account. **NOTE:** Only available for Enterprise plans.") + new_team_id: Optional[StrictStr] = Field(default=None, description="Id of the new Team.") + new_role: Optional[StrictStr] = Field(default=None, description="A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided.") + __properties: ClassVar[List[str]] = ["account_id", "email_address", "new_owner_email_address", "new_team_id", "new_role"] + + @field_validator('new_role') + def new_role_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Member', 'Developer', 'Team Manager', 'Admin']): + raise ValueError("must be one of enum values ('Member', 'Developer', 'Team Manager', 'Admin')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamRemoveMemberRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamRemoveMemberRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "new_owner_email_address": obj.get("new_owner_email_address"), + "new_team_id": obj.get("new_team_id"), + "new_role": obj.get("new_role") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account_id": "(str,)", + "email_address": "(str,)", + "new_owner_email_address": "(str,)", + "new_team_id": "(str,)", + "new_role": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/team_response.py b/dropbox_sign/models/team_response.py new file mode 100644 index 0000000..cba0fc0 --- /dev/null +++ b/dropbox_sign/models/team_response.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.account_response import AccountResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamResponse(BaseModel): + """ + Contains information about your team and its members + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of your Team") + accounts: Optional[List[AccountResponse]] = None + invited_accounts: Optional[List[AccountResponse]] = Field(default=None, description="A list of all Accounts that have an outstanding invitation to join your Team. Note that this response is a subset of the response parameters found in `GET /account`.") + invited_emails: Optional[List[StrictStr]] = Field(default=None, description="A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account.") + __properties: ClassVar[List[str]] = ["name", "accounts", "invited_accounts", "invited_emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in accounts (list) + _items = [] + if self.accounts: + for _item_accounts in self.accounts: + if _item_accounts: + _items.append(_item_accounts.to_dict()) + _dict['accounts'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in invited_accounts (list) + _items = [] + if self.invited_accounts: + for _item_invited_accounts in self.invited_accounts: + if _item_invited_accounts: + _items.append(_item_invited_accounts.to_dict()) + _dict['invited_accounts'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "accounts": [AccountResponse.from_dict(_item) for _item in obj["accounts"]] if obj.get("accounts") is not None else None, + "invited_accounts": [AccountResponse.from_dict(_item) for _item in obj["invited_accounts"]] if obj.get("invited_accounts") is not None else None, + "invited_emails": obj.get("invited_emails") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + "accounts": "(List[AccountResponse],)", + "invited_accounts": "(List[AccountResponse],)", + "invited_emails": "(List[str],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "accounts", + "invited_accounts", + "invited_emails", + ] + diff --git a/dropbox_sign/models/team_sub_teams_response.py b/dropbox_sign/models/team_sub_teams_response.py new file mode 100644 index 0000000..99b767e --- /dev/null +++ b/dropbox_sign/models/team_sub_teams_response.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.sub_team_response import SubTeamResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamSubTeamsResponse(BaseModel): + """ + TeamSubTeamsResponse + """ # noqa: E501 + sub_teams: List[SubTeamResponse] = Field(description="Contains a list with sub teams.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = None + __properties: ClassVar[List[str]] = ["sub_teams", "list_info", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamSubTeamsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in sub_teams (list) + _items = [] + if self.sub_teams: + for _item_sub_teams in self.sub_teams: + if _item_sub_teams: + _items.append(_item_sub_teams.to_dict()) + _dict['sub_teams'] = _items + # override the default output from pydantic by calling `to_dict()` of list_info + if self.list_info: + _dict['list_info'] = self.list_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamSubTeamsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sub_teams": [SubTeamResponse.from_dict(_item) for _item in obj["sub_teams"]] if obj.get("sub_teams") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "sub_teams": "(List[SubTeamResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "sub_teams", + "warnings", + ] + diff --git a/dropbox_sign/models/team_update_request.py b/dropbox_sign/models/team_update_request.py new file mode 100644 index 0000000..48eed77 --- /dev/null +++ b/dropbox_sign/models/team_update_request.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TeamUpdateRequest(BaseModel): + """ + TeamUpdateRequest + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of your Team.") + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TeamUpdateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TeamUpdateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_add_user_request.py b/dropbox_sign/models/template_add_user_request.py new file mode 100644 index 0000000..bf8702f --- /dev/null +++ b/dropbox_sign/models/template_add_user_request.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateAddUserRequest(BaseModel): + """ + TemplateAddUserRequest + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided.") + email_address: Optional[StrictStr] = Field(default=None, description="The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided.") + skip_notification: Optional[StrictBool] = Field(default=False, description="If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`.") + __properties: ClassVar[List[str]] = ["account_id", "email_address", "skip_notification"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateAddUserRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateAddUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "skip_notification": obj.get("skip_notification") if obj.get("skip_notification") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account_id": "(str,)", + "email_address": "(str,)", + "skip_notification": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_create_embedded_draft_request.py b/dropbox_sign/models/template_create_embedded_draft_request.py new file mode 100644 index 0000000..cd27ea0 --- /dev/null +++ b/dropbox_sign/models/template_create_embedded_draft_request.py @@ -0,0 +1,259 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_merge_field import SubMergeField +from dropbox_sign.models.sub_template_role import SubTemplateRole +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateCreateEmbeddedDraftRequest(BaseModel): + """ + TemplateCreateEmbeddedDraftRequest + """ # noqa: E501 + client_id: StrictStr = Field(description="Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + allow_ccs: Optional[StrictBool] = Field(default=True, description="This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_roles: Optional[List[StrictStr]] = Field(default=None, description="The CC roles that must be assigned when using the template to send a signature request") + editor_options: Optional[SubEditorOptions] = None + field_options: Optional[SubFieldOptions] = None + force_signer_roles: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template signer roles.") + force_subject_message: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template subject and message.") + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field(default=None, description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + merge_fields: Optional[List[SubMergeField]] = Field(default=None, description="Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The default template email message.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + show_preview: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + signer_roles: Optional[List[SubTemplateRole]] = Field(default=None, description="An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") + skip_me_now: Optional[StrictBool] = Field(default=False, description="Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") + subject: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="The template title (alias).") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[StrictStr] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + use_preexisting_fields: Optional[StrictBool] = Field(default=False, description="Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).") + __properties: ClassVar[List[str]] = ["client_id", "files", "file_urls", "allow_ccs", "allow_reassign", "attachments", "cc_roles", "editor_options", "field_options", "force_signer_roles", "force_subject_message", "form_field_groups", "form_field_rules", "form_fields_per_document", "merge_fields", "message", "metadata", "show_preview", "show_progress_stepper", "signer_roles", "skip_me_now", "subject", "test_mode", "title", "use_preexisting_fields"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateCreateEmbeddedDraftRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of editor_options + if self.editor_options: + _dict['editor_options'] = self.editor_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in merge_fields (list) + _items = [] + if self.merge_fields: + for _item_merge_fields in self.merge_fields: + if _item_merge_fields: + _items.append(_item_merge_fields.to_dict()) + _dict['merge_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signer_roles (list) + _items = [] + if self.signer_roles: + for _item_signer_roles in self.signer_roles: + if _item_signer_roles: + _items.append(_item_signer_roles.to_dict()) + _dict['signer_roles'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateCreateEmbeddedDraftRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "allow_ccs": obj.get("allow_ccs") if obj.get("allow_ccs") is not None else True, + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_roles": obj.get("cc_roles"), + "editor_options": SubEditorOptions.from_dict(obj["editor_options"]) if obj.get("editor_options") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "force_signer_roles": obj.get("force_signer_roles") if obj.get("force_signer_roles") is not None else False, + "force_subject_message": obj.get("force_subject_message") if obj.get("force_subject_message") is not None else False, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "merge_fields": [SubMergeField.from_dict(_item) for _item in obj["merge_fields"]] if obj.get("merge_fields") is not None else None, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "show_preview": obj.get("show_preview") if obj.get("show_preview") is not None else False, + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "signer_roles": [SubTemplateRole.from_dict(_item) for _item in obj["signer_roles"]] if obj.get("signer_roles") is not None else None, + "skip_me_now": obj.get("skip_me_now") if obj.get("skip_me_now") is not None else False, + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "use_preexisting_fields": obj.get("use_preexisting_fields") if obj.get("use_preexisting_fields") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "allow_ccs": "(bool,)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_roles": "(List[str],)", + "editor_options": "(SubEditorOptions,)", + "field_options": "(SubFieldOptions,)", + "force_signer_roles": "(bool,)", + "force_subject_message": "(bool,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "merge_fields": "(List[SubMergeField],)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "show_preview": "(bool,)", + "show_progress_stepper": "(bool,)", + "signer_roles": "(List[SubTemplateRole],)", + "skip_me_now": "(bool,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "use_preexisting_fields": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "attachments", + "cc_roles", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + "merge_fields", + "signer_roles", + ] + diff --git a/dropbox_sign/models/template_create_embedded_draft_response.py b/dropbox_sign/models/template_create_embedded_draft_response.py new file mode 100644 index 0000000..f3b951d --- /dev/null +++ b/dropbox_sign/models/template_create_embedded_draft_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_create_embedded_draft_response_template import TemplateCreateEmbeddedDraftResponseTemplate +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateCreateEmbeddedDraftResponse(BaseModel): + """ + TemplateCreateEmbeddedDraftResponse + """ # noqa: E501 + template: TemplateCreateEmbeddedDraftResponseTemplate + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["template", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateCreateEmbeddedDraftResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of template + if self.template: + _dict['template'] = self.template.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateCreateEmbeddedDraftResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template": TemplateCreateEmbeddedDraftResponseTemplate.from_dict(obj["template"]) if obj.get("template") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template": "(TemplateCreateEmbeddedDraftResponseTemplate,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/template_create_embedded_draft_response_template.py b/dropbox_sign/models/template_create_embedded_draft_response_template.py new file mode 100644 index 0000000..8aea2c7 --- /dev/null +++ b/dropbox_sign/models/template_create_embedded_draft_response_template.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateCreateEmbeddedDraftResponseTemplate(BaseModel): + """ + Template object with parameters: `template_id`, `edit_url`, `expires_at`. + """ # noqa: E501 + template_id: Optional[StrictStr] = Field(default=None, description="The id of the Template.") + edit_url: Optional[StrictStr] = Field(default=None, description="Link to edit the template.") + expires_at: Optional[StrictInt] = Field(default=None, description="When the link expires.") + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["template_id", "edit_url", "expires_at", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateCreateEmbeddedDraftResponseTemplate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateCreateEmbeddedDraftResponseTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_id": obj.get("template_id"), + "edit_url": obj.get("edit_url"), + "expires_at": obj.get("expires_at"), + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_id": "(str,)", + "edit_url": "(str,)", + "expires_at": "(int,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/template_create_request.py b/dropbox_sign/models/template_create_request.py new file mode 100644 index 0000000..06a9870 --- /dev/null +++ b/dropbox_sign/models/template_create_request.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_merge_field import SubMergeField +from dropbox_sign.models.sub_template_role import SubTemplateRole +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateCreateRequest(BaseModel): + """ + TemplateCreateRequest + """ # noqa: E501 + form_fields_per_document: List[SubFormFieldsPerDocumentBase] = Field(description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + signer_roles: List[SubTemplateRole] = Field(description="An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_roles: Optional[List[StrictStr]] = Field(default=None, description="The CC roles that must be assigned when using the template to send a signature request") + client_id: Optional[StrictStr] = Field(default=None, description="Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app.") + field_options: Optional[SubFieldOptions] = None + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + merge_fields: Optional[List[SubMergeField]] = Field(default=None, description="Add merge fields to the template. Merge fields are placed by the user creating the template and used to pre-fill data by passing values into signature requests with the `custom_fields` parameter. If the signature request using that template *does not* pass a value into a merge field, then an empty field remains in the document.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The default template email message.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + subject: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="The template title (alias).") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[StrictStr] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + use_preexisting_fields: Optional[StrictBool] = Field(default=False, description="Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`).") + __properties: ClassVar[List[str]] = ["form_fields_per_document", "signer_roles", "files", "file_urls", "allow_reassign", "attachments", "cc_roles", "client_id", "field_options", "form_field_groups", "form_field_rules", "merge_fields", "message", "metadata", "subject", "test_mode", "title", "use_preexisting_fields"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateCreateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signer_roles (list) + _items = [] + if self.signer_roles: + for _item_signer_roles in self.signer_roles: + if _item_signer_roles: + _items.append(_item_signer_roles.to_dict()) + _dict['signer_roles'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in merge_fields (list) + _items = [] + if self.merge_fields: + for _item_merge_fields in self.merge_fields: + if _item_merge_fields: + _items.append(_item_merge_fields.to_dict()) + _dict['merge_fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "signer_roles": [SubTemplateRole.from_dict(_item) for _item in obj["signer_roles"]] if obj.get("signer_roles") is not None else None, + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_roles": obj.get("cc_roles"), + "client_id": obj.get("client_id"), + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "merge_fields": [SubMergeField.from_dict(_item) for _item in obj["merge_fields"]] if obj.get("merge_fields") is not None else None, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "use_preexisting_fields": obj.get("use_preexisting_fields") if obj.get("use_preexisting_fields") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "signer_roles": "(List[SubTemplateRole],)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_roles": "(List[str],)", + "client_id": "(str,)", + "field_options": "(SubFieldOptions,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "merge_fields": "(List[SubMergeField],)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "use_preexisting_fields": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "form_fields_per_document", + "signer_roles", + "files", + "file_urls", + "attachments", + "cc_roles", + "form_field_groups", + "form_field_rules", + "merge_fields", + ] + diff --git a/dropbox_sign/models/template_create_response.py b/dropbox_sign/models/template_create_response.py new file mode 100644 index 0000000..b6191ba --- /dev/null +++ b/dropbox_sign/models/template_create_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_create_response_template import TemplateCreateResponseTemplate +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateCreateResponse(BaseModel): + """ + TemplateCreateResponse + """ # noqa: E501 + template: TemplateCreateResponseTemplate + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["template", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateCreateResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of template + if self.template: + _dict['template'] = self.template.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateCreateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template": TemplateCreateResponseTemplate.from_dict(obj["template"]) if obj.get("template") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template": "(TemplateCreateResponseTemplate,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/template_create_response_template.py b/dropbox_sign/models/template_create_response_template.py new file mode 100644 index 0000000..aa5ab6f --- /dev/null +++ b/dropbox_sign/models/template_create_response_template.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateCreateResponseTemplate(BaseModel): + """ + Template object with parameters: `template_id`. + """ # noqa: E501 + template_id: Optional[StrictStr] = Field(default=None, description="The id of the Template.") + __properties: ClassVar[List[str]] = ["template_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateCreateResponseTemplate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateCreateResponseTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_id": obj.get("template_id") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_edit_response.py b/dropbox_sign/models/template_edit_response.py new file mode 100644 index 0000000..3e067aa --- /dev/null +++ b/dropbox_sign/models/template_edit_response.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateEditResponse(BaseModel): + """ + TemplateEditResponse + """ # noqa: E501 + template_id: StrictStr = Field(description="The id of the Template.") + __properties: ClassVar[List[str]] = ["template_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateEditResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateEditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_id": obj.get("template_id") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_id": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_get_response.py b/dropbox_sign/models/template_get_response.py new file mode 100644 index 0000000..90d28f2 --- /dev/null +++ b/dropbox_sign/models/template_get_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response import TemplateResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateGetResponse(BaseModel): + """ + TemplateGetResponse + """ # noqa: E501 + template: TemplateResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["template", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateGetResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of template + if self.template: + _dict['template'] = self.template.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template": TemplateResponse.from_dict(obj["template"]) if obj.get("template") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template": "(TemplateResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/template_list_response.py b/dropbox_sign/models/template_list_response.py new file mode 100644 index 0000000..07dc9fa --- /dev/null +++ b/dropbox_sign/models/template_list_response.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.list_info_response import ListInfoResponse +from dropbox_sign.models.template_response import TemplateResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateListResponse(BaseModel): + """ + TemplateListResponse + """ # noqa: E501 + templates: List[TemplateResponse] = Field(description="List of templates that the API caller has access to.") + list_info: ListInfoResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["templates", "list_info", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in templates (list) + _items = [] + if self.templates: + for _item_templates in self.templates: + if _item_templates: + _items.append(_item_templates.to_dict()) + _dict['templates'] = _items + # override the default output from pydantic by calling `to_dict()` of list_info + if self.list_info: + _dict['list_info'] = self.list_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "templates": [TemplateResponse.from_dict(_item) for _item in obj["templates"]] if obj.get("templates") is not None else None, + "list_info": ListInfoResponse.from_dict(obj["list_info"]) if obj.get("list_info") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "templates": "(List[TemplateResponse],)", + "list_info": "(ListInfoResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "templates", + "warnings", + ] + diff --git a/dropbox_sign/models/template_remove_user_request.py b/dropbox_sign/models/template_remove_user_request.py new file mode 100644 index 0000000..335ef82 --- /dev/null +++ b/dropbox_sign/models/template_remove_user_request.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateRemoveUserRequest(BaseModel): + """ + TemplateRemoveUserRequest + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.") + email_address: Optional[StrictStr] = Field(default=None, description="The id or email address of the Account to remove access to the Template. The account id prevails if both are provided.") + __properties: ClassVar[List[str]] = ["account_id", "email_address"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateRemoveUserRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateRemoveUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account_id": "(str,)", + "email_address": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response.py b/dropbox_sign/models/template_response.py new file mode 100644 index 0000000..246f4d3 --- /dev/null +++ b/dropbox_sign/models/template_response.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_account import TemplateResponseAccount +from dropbox_sign.models.template_response_cc_role import TemplateResponseCCRole +from dropbox_sign.models.template_response_document import TemplateResponseDocument +from dropbox_sign.models.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_signer_role import TemplateResponseSignerRole +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponse(BaseModel): + """ + Contains information about the templates you and your team have created. + """ # noqa: E501 + template_id: Optional[StrictStr] = Field(default=None, description="The id of the Template.") + title: Optional[StrictStr] = Field(default=None, description="The title of the Template. This will also be the default subject of the message sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.") + message: Optional[StrictStr] = Field(default=None, description="The default message that will be sent to signers when using this Template to send a SignatureRequest. This can be overridden when sending the SignatureRequest.") + updated_at: Optional[StrictInt] = Field(default=None, description="Time the template was last updated.") + is_embedded: Optional[StrictBool] = Field(default=None, description="`true` if this template was created using an embedded flow, `false` if it was created on our website.") + is_creator: Optional[StrictBool] = Field(default=None, description="`true` if you are the owner of this template, `false` if it's been shared with you by a team member.") + can_edit: Optional[StrictBool] = Field(default=None, description="Indicates whether edit rights have been granted to you by the owner (always `true` if that's you).") + is_locked: Optional[StrictBool] = Field(default=None, description="Indicates whether the template is locked. If `true`, then the template was created outside your quota and can only be used in `test_mode`. If `false`, then the template is within your quota and can be used to create signature requests.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata attached to the template.") + signer_roles: Optional[List[TemplateResponseSignerRole]] = Field(default=None, description="An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template.") + cc_roles: Optional[List[TemplateResponseCCRole]] = Field(default=None, description="An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template.") + documents: Optional[List[TemplateResponseDocument]] = Field(default=None, description="An array describing each document associated with this Template. Includes form field data for each document.") + custom_fields: Optional[List[TemplateResponseDocumentCustomFieldBase]] = Field(default=None, description="Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.") + named_form_fields: Optional[List[TemplateResponseDocumentFormFieldBase]] = Field(default=None, description="Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead.") + accounts: Optional[List[TemplateResponseAccount]] = Field(default=None, description="An array of the Accounts that can use this Template.") + __properties: ClassVar[List[str]] = ["template_id", "title", "message", "updated_at", "is_embedded", "is_creator", "can_edit", "is_locked", "metadata", "signer_roles", "cc_roles", "documents", "custom_fields", "named_form_fields", "accounts"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in signer_roles (list) + _items = [] + if self.signer_roles: + for _item_signer_roles in self.signer_roles: + if _item_signer_roles: + _items.append(_item_signer_roles.to_dict()) + _dict['signer_roles'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in cc_roles (list) + _items = [] + if self.cc_roles: + for _item_cc_roles in self.cc_roles: + if _item_cc_roles: + _items.append(_item_cc_roles.to_dict()) + _dict['cc_roles'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in documents (list) + _items = [] + if self.documents: + for _item_documents in self.documents: + if _item_documents: + _items.append(_item_documents.to_dict()) + _dict['documents'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in named_form_fields (list) + _items = [] + if self.named_form_fields: + for _item_named_form_fields in self.named_form_fields: + if _item_named_form_fields: + _items.append(_item_named_form_fields.to_dict()) + _dict['named_form_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in accounts (list) + _items = [] + if self.accounts: + for _item_accounts in self.accounts: + if _item_accounts: + _items.append(_item_accounts.to_dict()) + _dict['accounts'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_id": obj.get("template_id"), + "title": obj.get("title"), + "message": obj.get("message"), + "updated_at": obj.get("updated_at"), + "is_embedded": obj.get("is_embedded"), + "is_creator": obj.get("is_creator"), + "can_edit": obj.get("can_edit"), + "is_locked": obj.get("is_locked"), + "metadata": obj.get("metadata"), + "signer_roles": [TemplateResponseSignerRole.from_dict(_item) for _item in obj["signer_roles"]] if obj.get("signer_roles") is not None else None, + "cc_roles": [TemplateResponseCCRole.from_dict(_item) for _item in obj["cc_roles"]] if obj.get("cc_roles") is not None else None, + "documents": [TemplateResponseDocument.from_dict(_item) for _item in obj["documents"]] if obj.get("documents") is not None else None, + "custom_fields": [TemplateResponseDocumentCustomFieldBase.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "named_form_fields": [TemplateResponseDocumentFormFieldBase.from_dict(_item) for _item in obj["named_form_fields"]] if obj.get("named_form_fields") is not None else None, + "accounts": [TemplateResponseAccount.from_dict(_item) for _item in obj["accounts"]] if obj.get("accounts") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_id": "(str,)", + "title": "(str,)", + "message": "(str,)", + "updated_at": "(int,)", + "is_embedded": "(bool,)", + "is_creator": "(bool,)", + "can_edit": "(bool,)", + "is_locked": "(bool,)", + "metadata": "(object,)", + "signer_roles": "(List[TemplateResponseSignerRole],)", + "cc_roles": "(List[TemplateResponseCCRole],)", + "documents": "(List[TemplateResponseDocument],)", + "custom_fields": "(List[TemplateResponseDocumentCustomFieldBase],)", + "named_form_fields": "(List[TemplateResponseDocumentFormFieldBase],)", + "accounts": "(List[TemplateResponseAccount],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "signer_roles", + "cc_roles", + "documents", + "custom_fields", + "named_form_fields", + "accounts", + ] + diff --git a/dropbox_sign/models/template_response_account.py b/dropbox_sign/models/template_response_account.py new file mode 100644 index 0000000..9e8f4c1 --- /dev/null +++ b/dropbox_sign/models/template_response_account.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_account_quota import TemplateResponseAccountQuota +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseAccount(BaseModel): + """ + TemplateResponseAccount + """ # noqa: E501 + account_id: Optional[StrictStr] = Field(default=None, description="The id of the Account.") + email_address: Optional[StrictStr] = Field(default=None, description="The email address associated with the Account.") + is_locked: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has been locked out of their account by a team admin.") + is_paid_hs: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has a paid Dropbox Sign account.") + is_paid_hf: Optional[StrictBool] = Field(default=None, description="Returns `true` if the user has a paid HelloFax account.") + quotas: Optional[TemplateResponseAccountQuota] = None + __properties: ClassVar[List[str]] = ["account_id", "email_address", "is_locked", "is_paid_hs", "is_paid_hf", "quotas"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseAccount from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of quotas + if self.quotas: + _dict['quotas'] = self.quotas.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseAccount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "email_address": obj.get("email_address"), + "is_locked": obj.get("is_locked"), + "is_paid_hs": obj.get("is_paid_hs"), + "is_paid_hf": obj.get("is_paid_hf"), + "quotas": TemplateResponseAccountQuota.from_dict(obj["quotas"]) if obj.get("quotas") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "account_id": "(str,)", + "email_address": "(str,)", + "is_locked": "(bool,)", + "is_paid_hs": "(bool,)", + "is_paid_hf": "(bool,)", + "quotas": "(TemplateResponseAccountQuota,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_account_quota.py b/dropbox_sign/models/template_response_account_quota.py new file mode 100644 index 0000000..8ffa3c4 --- /dev/null +++ b/dropbox_sign/models/template_response_account_quota.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseAccountQuota(BaseModel): + """ + An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. + """ # noqa: E501 + templates_left: Optional[StrictInt] = Field(default=None, description="API templates remaining.") + api_signature_requests_left: Optional[StrictInt] = Field(default=None, description="API signature requests remaining.") + documents_left: Optional[StrictInt] = Field(default=None, description="Signature requests remaining.") + sms_verifications_left: Optional[StrictInt] = Field(default=None, description="SMS verifications remaining.") + __properties: ClassVar[List[str]] = ["templates_left", "api_signature_requests_left", "documents_left", "sms_verifications_left"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseAccountQuota from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseAccountQuota from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "templates_left": obj.get("templates_left"), + "api_signature_requests_left": obj.get("api_signature_requests_left"), + "documents_left": obj.get("documents_left"), + "sms_verifications_left": obj.get("sms_verifications_left") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "templates_left": "(int,)", + "api_signature_requests_left": "(int,)", + "documents_left": "(int,)", + "sms_verifications_left": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_cc_role.py b/dropbox_sign/models/template_response_cc_role.py new file mode 100644 index 0000000..953966e --- /dev/null +++ b/dropbox_sign/models/template_response_cc_role.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseCCRole(BaseModel): + """ + TemplateResponseCCRole + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the Role.") + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseCCRole from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseCCRole from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document.py b/dropbox_sign/models/template_response_document.py new file mode 100644 index 0000000..d296ee2 --- /dev/null +++ b/dropbox_sign/models/template_response_document.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from dropbox_sign.models.template_response_document_field_group import TemplateResponseDocumentFieldGroup +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocument(BaseModel): + """ + TemplateResponseDocument + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Name of the associated file.") + index: Optional[StrictInt] = Field(default=None, description="Document ordering, the lowest index is displayed first and the highest last (0-based indexing).") + field_groups: Optional[List[TemplateResponseDocumentFieldGroup]] = Field(default=None, description="An array of Form Field Group objects.") + form_fields: Optional[List[TemplateResponseDocumentFormFieldBase]] = Field(default=None, description="An array of Form Field objects containing the name and type of each named field.") + custom_fields: Optional[List[TemplateResponseDocumentCustomFieldBase]] = Field(default=None, description="An array of Form Field objects containing the name and type of each named field.") + static_fields: Optional[List[TemplateResponseDocumentStaticFieldBase]] = Field(default=None, description="An array describing static overlay fields. **NOTE:** Only available for certain subscriptions.") + __properties: ClassVar[List[str]] = ["name", "index", "field_groups", "form_fields", "custom_fields", "static_fields"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocument from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in field_groups (list) + _items = [] + if self.field_groups: + for _item_field_groups in self.field_groups: + if _item_field_groups: + _items.append(_item_field_groups.to_dict()) + _dict['field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields (list) + _items = [] + if self.form_fields: + for _item_form_fields in self.form_fields: + if _item_form_fields: + _items.append(_item_form_fields.to_dict()) + _dict['form_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in static_fields (list) + _items = [] + if self.static_fields: + for _item_static_fields in self.static_fields: + if _item_static_fields: + _items.append(_item_static_fields.to_dict()) + _dict['static_fields'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocument from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "index": obj.get("index"), + "field_groups": [TemplateResponseDocumentFieldGroup.from_dict(_item) for _item in obj["field_groups"]] if obj.get("field_groups") is not None else None, + "form_fields": [TemplateResponseDocumentFormFieldBase.from_dict(_item) for _item in obj["form_fields"]] if obj.get("form_fields") is not None else None, + "custom_fields": [TemplateResponseDocumentCustomFieldBase.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "static_fields": [TemplateResponseDocumentStaticFieldBase.from_dict(_item) for _item in obj["static_fields"]] if obj.get("static_fields") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + "index": "(int,)", + "field_groups": "(List[TemplateResponseDocumentFieldGroup],)", + "form_fields": "(List[TemplateResponseDocumentFormFieldBase],)", + "custom_fields": "(List[TemplateResponseDocumentCustomFieldBase],)", + "static_fields": "(List[TemplateResponseDocumentStaticFieldBase],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "field_groups", + "form_fields", + "custom_fields", + "static_fields", + ] + diff --git a/dropbox_sign/models/template_response_document_custom_field_base.py b/dropbox_sign/models/template_response_document_custom_field_base.py new file mode 100644 index 0000000..eddd054 --- /dev/null +++ b/dropbox_sign/models/template_response_document_custom_field_base.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.template_response_document_custom_field_checkbox import TemplateResponseDocumentCustomFieldCheckbox + from dropbox_sign.models.template_response_document_custom_field_text import TemplateResponseDocumentCustomFieldText + +class TemplateResponseDocumentCustomFieldBase(BaseModel): + """ + An array of Form Field objects containing the name and type of each named field. + """ # noqa: E501 + type: StrictStr + api_id: Optional[StrictStr] = Field(default=None, description="The unique ID for this field.") + name: Optional[StrictStr] = Field(default=None, description="The name of the Custom Field.") + signer: Union[StrictStr, StrictInt, None] = Field(description="The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).") + x: Optional[StrictInt] = Field(default=None, description="The horizontal offset in pixels for this form field.") + y: Optional[StrictInt] = Field(default=None, description="The vertical offset in pixels for this form field.") + width: Optional[StrictInt] = Field(default=None, description="The width in pixels of this form field.") + height: Optional[StrictInt] = Field(default=None, description="The height in pixels of this form field.") + required: Optional[StrictBool] = Field(default=None, description="Boolean showing whether or not this field is required.") + group: Optional[StrictStr] = Field(default=None, description="The name of the group this field is in. If this field is not a group, this defaults to `null`.") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'TemplateResponseDocumentCustomFieldCheckbox','text': 'TemplateResponseDocumentCustomFieldText' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText]]: + """Create an instance of TemplateResponseDocumentCustomFieldBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[TemplateResponseDocumentCustomFieldCheckbox, TemplateResponseDocumentCustomFieldText]]: + """Create an instance of TemplateResponseDocumentCustomFieldBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'TemplateResponseDocumentCustomFieldCheckbox': + return import_module("dropbox_sign.models.template_response_document_custom_field_checkbox").TemplateResponseDocumentCustomFieldCheckbox.from_dict(obj) + if object_type == 'TemplateResponseDocumentCustomFieldText': + return import_module("dropbox_sign.models.template_response_document_custom_field_text").TemplateResponseDocumentCustomFieldText.from_dict(obj) + + raise ValueError("TemplateResponseDocumentCustomFieldBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_custom_field_checkbox.py b/dropbox_sign/models/template_response_document_custom_field_checkbox.py new file mode 100644 index 0000000..6180833 --- /dev/null +++ b/dropbox_sign/models/template_response_document_custom_field_checkbox.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentCustomFieldCheckbox(TemplateResponseDocumentCustomFieldBase): + """ + This class extends `TemplateResponseDocumentCustomFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentCustomFieldCheckbox from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentCustomFieldCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_custom_field_text.py b/dropbox_sign/models/template_response_document_custom_field_text.py new file mode 100644 index 0000000..761cfa6 --- /dev/null +++ b/dropbox_sign/models/template_response_document_custom_field_text.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_document_custom_field_base import TemplateResponseDocumentCustomFieldBase +from dropbox_sign.models.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentCustomFieldText(TemplateResponseDocumentCustomFieldBase): + """ + This class extends `TemplateResponseDocumentCustomFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox`") + avg_text_length: Optional[TemplateResponseFieldAvgTextLength] = None + is_multiline: Optional[StrictBool] = Field(default=None, description="Whether this form field is multiline text.", alias="isMultiline") + original_font_size: Optional[StrictInt] = Field(default=None, description="Original font size used in this form field's text.", alias="originalFontSize") + font_family: Optional[StrictStr] = Field(default=None, description="Font family used in this form field's text.", alias="fontFamily") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group", "avg_text_length", "isMultiline", "originalFontSize", "fontFamily"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentCustomFieldText from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of avg_text_length + if self.avg_text_length: + _dict['avg_text_length'] = self.avg_text_length.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentCustomFieldText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'text', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group"), + "avg_text_length": TemplateResponseFieldAvgTextLength.from_dict(obj["avg_text_length"]) if obj.get("avg_text_length") is not None else None, + "isMultiline": obj.get("isMultiline"), + "originalFontSize": obj.get("originalFontSize"), + "fontFamily": obj.get("fontFamily") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "avg_text_length": "(TemplateResponseFieldAvgTextLength,)", + "is_multiline": "(bool,)", + "original_font_size": "(int,)", + "font_family": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_field_group.py b/dropbox_sign/models/template_response_document_field_group.py new file mode 100644 index 0000000..4d56074 --- /dev/null +++ b/dropbox_sign/models/template_response_document_field_group.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_document_field_group_rule import TemplateResponseDocumentFieldGroupRule +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFieldGroup(BaseModel): + """ + TemplateResponseDocumentFieldGroup + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the form field group.") + rule: Optional[TemplateResponseDocumentFieldGroupRule] = None + __properties: ClassVar[List[str]] = ["name", "rule"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFieldGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of rule + if self.rule: + _dict['rule'] = self.rule.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFieldGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "rule": TemplateResponseDocumentFieldGroupRule.from_dict(obj["rule"]) if obj.get("rule") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + "rule": "(TemplateResponseDocumentFieldGroupRule,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_field_group_rule.py b/dropbox_sign/models/template_response_document_field_group_rule.py new file mode 100644 index 0000000..b3e0718 --- /dev/null +++ b/dropbox_sign/models/template_response_document_field_group_rule.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFieldGroupRule(BaseModel): + """ + The rule used to validate checkboxes in the form field group. See [checkbox field grouping](/api/reference/constants/#checkbox-field-grouping). + """ # noqa: E501 + requirement: Optional[StrictStr] = Field(default=None, description="Examples: `require_0-1` `require_1` `require_1-ormore` - Check out the list of [acceptable `requirement` checkbox type values](/api/reference/constants/#checkbox-field-grouping). - Check out the list of [acceptable `requirement` radio type fields](/api/reference/constants/#radio-field-grouping). - Radio groups require **at least** two fields per group.") + group_label: Optional[StrictStr] = Field(default=None, description="Name of the group", alias="groupLabel") + __properties: ClassVar[List[str]] = ["requirement", "groupLabel"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFieldGroupRule from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFieldGroupRule from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "requirement": obj.get("requirement"), + "groupLabel": obj.get("groupLabel") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "requirement": "(str,)", + "group_label": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_form_field_base.py b/dropbox_sign/models/template_response_document_form_field_base.py new file mode 100644 index 0000000..dc85137 --- /dev/null +++ b/dropbox_sign/models/template_response_document_form_field_base.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.template_response_document_form_field_checkbox import TemplateResponseDocumentFormFieldCheckbox + from dropbox_sign.models.template_response_document_form_field_date_signed import TemplateResponseDocumentFormFieldDateSigned + from dropbox_sign.models.template_response_document_form_field_dropdown import TemplateResponseDocumentFormFieldDropdown + from dropbox_sign.models.template_response_document_form_field_hyperlink import TemplateResponseDocumentFormFieldHyperlink + from dropbox_sign.models.template_response_document_form_field_initials import TemplateResponseDocumentFormFieldInitials + from dropbox_sign.models.template_response_document_form_field_radio import TemplateResponseDocumentFormFieldRadio + from dropbox_sign.models.template_response_document_form_field_signature import TemplateResponseDocumentFormFieldSignature + from dropbox_sign.models.template_response_document_form_field_text import TemplateResponseDocumentFormFieldText + +class TemplateResponseDocumentFormFieldBase(BaseModel): + """ + An array of Form Field objects containing the name and type of each named field. + """ # noqa: E501 + type: StrictStr + api_id: Optional[StrictStr] = Field(default=None, description="A unique id for the form field.") + name: Optional[StrictStr] = Field(default=None, description="The name of the form field.") + signer: Union[StrictStr, StrictInt] = Field(description="The signer of the Form Field.") + x: Optional[StrictInt] = Field(default=None, description="The horizontal offset in pixels for this form field.") + y: Optional[StrictInt] = Field(default=None, description="The vertical offset in pixels for this form field.") + width: Optional[StrictInt] = Field(default=None, description="The width in pixels of this form field.") + height: Optional[StrictInt] = Field(default=None, description="The height in pixels of this form field.") + required: Optional[StrictBool] = Field(default=None, description="Boolean showing whether or not this field is required.") + group: Optional[StrictStr] = Field(default=None, description="The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'TemplateResponseDocumentFormFieldCheckbox','date_signed': 'TemplateResponseDocumentFormFieldDateSigned','dropdown': 'TemplateResponseDocumentFormFieldDropdown','hyperlink': 'TemplateResponseDocumentFormFieldHyperlink','initials': 'TemplateResponseDocumentFormFieldInitials','radio': 'TemplateResponseDocumentFormFieldRadio','signature': 'TemplateResponseDocumentFormFieldSignature','text': 'TemplateResponseDocumentFormFieldText' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText]]: + """Create an instance of TemplateResponseDocumentFormFieldBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[TemplateResponseDocumentFormFieldCheckbox, TemplateResponseDocumentFormFieldDateSigned, TemplateResponseDocumentFormFieldDropdown, TemplateResponseDocumentFormFieldHyperlink, TemplateResponseDocumentFormFieldInitials, TemplateResponseDocumentFormFieldRadio, TemplateResponseDocumentFormFieldSignature, TemplateResponseDocumentFormFieldText]]: + """Create an instance of TemplateResponseDocumentFormFieldBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'TemplateResponseDocumentFormFieldCheckbox': + return import_module("dropbox_sign.models.template_response_document_form_field_checkbox").TemplateResponseDocumentFormFieldCheckbox.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldDateSigned': + return import_module("dropbox_sign.models.template_response_document_form_field_date_signed").TemplateResponseDocumentFormFieldDateSigned.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldDropdown': + return import_module("dropbox_sign.models.template_response_document_form_field_dropdown").TemplateResponseDocumentFormFieldDropdown.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldHyperlink': + return import_module("dropbox_sign.models.template_response_document_form_field_hyperlink").TemplateResponseDocumentFormFieldHyperlink.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldInitials': + return import_module("dropbox_sign.models.template_response_document_form_field_initials").TemplateResponseDocumentFormFieldInitials.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldRadio': + return import_module("dropbox_sign.models.template_response_document_form_field_radio").TemplateResponseDocumentFormFieldRadio.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldSignature': + return import_module("dropbox_sign.models.template_response_document_form_field_signature").TemplateResponseDocumentFormFieldSignature.from_dict(obj) + if object_type == 'TemplateResponseDocumentFormFieldText': + return import_module("dropbox_sign.models.template_response_document_form_field_text").TemplateResponseDocumentFormFieldText.from_dict(obj) + + raise ValueError("TemplateResponseDocumentFormFieldBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_form_field_checkbox.py b/dropbox_sign/models/template_response_document_form_field_checkbox.py new file mode 100644 index 0000000..9cd961d --- /dev/null +++ b/dropbox_sign/models/template_response_document_form_field_checkbox.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldCheckbox(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldCheckbox from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_form_field_date_signed.py b/dropbox_sign/models/template_response_document_form_field_date_signed.py new file mode 100644 index 0000000..130dd8d --- /dev/null +++ b/dropbox_sign/models/template_response_document_form_field_date_signed.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldDateSigned(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldDateSigned from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldDateSigned from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'date_signed', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_form_field_dropdown.py b/dropbox_sign/models/template_response_document_form_field_dropdown.py new file mode 100644 index 0000000..c135186 --- /dev/null +++ b/dropbox_sign/models/template_response_document_form_field_dropdown.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldDropdown(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldDropdown from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldDropdown from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'dropdown', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_form_field_hyperlink.py b/dropbox_sign/models/template_response_document_form_field_hyperlink.py new file mode 100644 index 0000000..fb8eb9d --- /dev/null +++ b/dropbox_sign/models/template_response_document_form_field_hyperlink.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldHyperlink(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + avg_text_length: Optional[TemplateResponseFieldAvgTextLength] = None + is_multiline: Optional[StrictBool] = Field(default=None, description="Whether this form field is multiline text.", alias="isMultiline") + original_font_size: Optional[StrictInt] = Field(default=None, description="Original font size used in this form field's text.", alias="originalFontSize") + font_family: Optional[StrictStr] = Field(default=None, description="Font family used in this form field's text.", alias="fontFamily") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group", "avg_text_length", "isMultiline", "originalFontSize", "fontFamily"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldHyperlink from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of avg_text_length + if self.avg_text_length: + _dict['avg_text_length'] = self.avg_text_length.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldHyperlink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'hyperlink', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group"), + "avg_text_length": TemplateResponseFieldAvgTextLength.from_dict(obj["avg_text_length"]) if obj.get("avg_text_length") is not None else None, + "isMultiline": obj.get("isMultiline"), + "originalFontSize": obj.get("originalFontSize"), + "fontFamily": obj.get("fontFamily") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "avg_text_length": "(TemplateResponseFieldAvgTextLength,)", + "is_multiline": "(bool,)", + "original_font_size": "(int,)", + "font_family": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_form_field_initials.py b/dropbox_sign/models/template_response_document_form_field_initials.py new file mode 100644 index 0000000..2656c89 --- /dev/null +++ b/dropbox_sign/models/template_response_document_form_field_initials.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldInitials(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldInitials from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldInitials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'initials', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_form_field_radio.py b/dropbox_sign/models/template_response_document_form_field_radio.py new file mode 100644 index 0000000..5eb2cf3 --- /dev/null +++ b/dropbox_sign/models/template_response_document_form_field_radio.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldRadio(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "group", "api_id", "name", "signer", "x", "y", "width", "height", "required"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldRadio from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldRadio from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'radio', + "group": obj.get("group"), + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "group": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_form_field_signature.py b/dropbox_sign/models/template_response_document_form_field_signature.py new file mode 100644 index 0000000..94741f8 --- /dev/null +++ b/dropbox_sign/models/template_response_document_form_field_signature.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldSignature(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldSignature from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldSignature from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'signature', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_form_field_text.py b/dropbox_sign/models/template_response_document_form_field_text.py new file mode 100644 index 0000000..617885e --- /dev/null +++ b/dropbox_sign/models/template_response_document_form_field_text.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.template_response_document_form_field_base import TemplateResponseDocumentFormFieldBase +from dropbox_sign.models.template_response_field_avg_text_length import TemplateResponseFieldAvgTextLength +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentFormFieldText(TemplateResponseDocumentFormFieldBase): + """ + This class extends `TemplateResponseDocumentFormFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this form field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentFormFieldText` * Dropdown Field uses `TemplateResponseDocumentFormFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentFormFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentFormFieldCheckbox` * Radio Field uses `TemplateResponseDocumentFormFieldRadio` * Signature Field uses `TemplateResponseDocumentFormFieldSignature` * Date Signed Field uses `TemplateResponseDocumentFormFieldDateSigned` * Initials Field uses `TemplateResponseDocumentFormFieldInitials`") + avg_text_length: Optional[TemplateResponseFieldAvgTextLength] = None + is_multiline: Optional[StrictBool] = Field(default=None, description="Whether this form field is multiline text.", alias="isMultiline") + original_font_size: Optional[StrictInt] = Field(default=None, description="Original font size used in this form field's text.", alias="originalFontSize") + font_family: Optional[StrictStr] = Field(default=None, description="Font family used in this form field's text.", alias="fontFamily") + validation_type: Optional[StrictStr] = Field(default=None, description="Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group", "avg_text_length", "isMultiline", "originalFontSize", "fontFamily", "validation_type"] + + @field_validator('validation_type') + def validation_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['numbers_only', 'letters_only', 'phone_number', 'bank_routing_number', 'bank_account_number', 'email_address', 'zip_code', 'social_security_number', 'employer_identification_number', 'custom_regex']): + raise ValueError("must be one of enum values ('numbers_only', 'letters_only', 'phone_number', 'bank_routing_number', 'bank_account_number', 'email_address', 'zip_code', 'social_security_number', 'employer_identification_number', 'custom_regex')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldText from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of avg_text_length + if self.avg_text_length: + _dict['avg_text_length'] = self.avg_text_length.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentFormFieldText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'text', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer"), + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group"), + "avg_text_length": TemplateResponseFieldAvgTextLength.from_dict(obj["avg_text_length"]) if obj.get("avg_text_length") is not None else None, + "isMultiline": obj.get("isMultiline"), + "originalFontSize": obj.get("originalFontSize"), + "fontFamily": obj.get("fontFamily"), + "validation_type": obj.get("validation_type") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "avg_text_length": "(TemplateResponseFieldAvgTextLength,)", + "is_multiline": "(bool,)", + "original_font_size": "(int,)", + "font_family": "(str,)", + "validation_type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(int, str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_static_field_base.py b/dropbox_sign/models/template_response_document_static_field_base.py new file mode 100644 index 0000000..c0a5308 --- /dev/null +++ b/dropbox_sign/models/template_response_document_static_field_base.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from importlib import import_module +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from dropbox_sign.models.template_response_document_static_field_checkbox import TemplateResponseDocumentStaticFieldCheckbox + from dropbox_sign.models.template_response_document_static_field_date_signed import TemplateResponseDocumentStaticFieldDateSigned + from dropbox_sign.models.template_response_document_static_field_dropdown import TemplateResponseDocumentStaticFieldDropdown + from dropbox_sign.models.template_response_document_static_field_hyperlink import TemplateResponseDocumentStaticFieldHyperlink + from dropbox_sign.models.template_response_document_static_field_initials import TemplateResponseDocumentStaticFieldInitials + from dropbox_sign.models.template_response_document_static_field_radio import TemplateResponseDocumentStaticFieldRadio + from dropbox_sign.models.template_response_document_static_field_signature import TemplateResponseDocumentStaticFieldSignature + from dropbox_sign.models.template_response_document_static_field_text import TemplateResponseDocumentStaticFieldText + +class TemplateResponseDocumentStaticFieldBase(BaseModel): + """ + An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. + """ # noqa: E501 + type: StrictStr + api_id: Optional[StrictStr] = Field(default=None, description="A unique id for the static field.") + name: Optional[StrictStr] = Field(default=None, description="The name of the static field.") + signer: Optional[StrictStr] = Field(default='me_now', description="The signer of the Static Field.") + x: Optional[StrictInt] = Field(default=None, description="The horizontal offset in pixels for this static field.") + y: Optional[StrictInt] = Field(default=None, description="The vertical offset in pixels for this static field.") + width: Optional[StrictInt] = Field(default=None, description="The width in pixels of this static field.") + height: Optional[StrictInt] = Field(default=None, description="The height in pixels of this static field.") + required: Optional[StrictBool] = Field(default=None, description="Boolean showing whether or not this field is required.") + group: Optional[StrictStr] = Field(default=None, description="The name of the group this field is in. If this field is not a group, this defaults to `null`.") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'checkbox': 'TemplateResponseDocumentStaticFieldCheckbox','date_signed': 'TemplateResponseDocumentStaticFieldDateSigned','dropdown': 'TemplateResponseDocumentStaticFieldDropdown','hyperlink': 'TemplateResponseDocumentStaticFieldHyperlink','initials': 'TemplateResponseDocumentStaticFieldInitials','radio': 'TemplateResponseDocumentStaticFieldRadio','signature': 'TemplateResponseDocumentStaticFieldSignature','text': 'TemplateResponseDocumentStaticFieldText' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Union[TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText]]: + """Create an instance of TemplateResponseDocumentStaticFieldBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[TemplateResponseDocumentStaticFieldCheckbox, TemplateResponseDocumentStaticFieldDateSigned, TemplateResponseDocumentStaticFieldDropdown, TemplateResponseDocumentStaticFieldHyperlink, TemplateResponseDocumentStaticFieldInitials, TemplateResponseDocumentStaticFieldRadio, TemplateResponseDocumentStaticFieldSignature, TemplateResponseDocumentStaticFieldText]]: + """Create an instance of TemplateResponseDocumentStaticFieldBase from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type == 'TemplateResponseDocumentStaticFieldCheckbox': + return import_module("dropbox_sign.models.template_response_document_static_field_checkbox").TemplateResponseDocumentStaticFieldCheckbox.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldDateSigned': + return import_module("dropbox_sign.models.template_response_document_static_field_date_signed").TemplateResponseDocumentStaticFieldDateSigned.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldDropdown': + return import_module("dropbox_sign.models.template_response_document_static_field_dropdown").TemplateResponseDocumentStaticFieldDropdown.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldHyperlink': + return import_module("dropbox_sign.models.template_response_document_static_field_hyperlink").TemplateResponseDocumentStaticFieldHyperlink.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldInitials': + return import_module("dropbox_sign.models.template_response_document_static_field_initials").TemplateResponseDocumentStaticFieldInitials.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldRadio': + return import_module("dropbox_sign.models.template_response_document_static_field_radio").TemplateResponseDocumentStaticFieldRadio.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldSignature': + return import_module("dropbox_sign.models.template_response_document_static_field_signature").TemplateResponseDocumentStaticFieldSignature.from_dict(obj) + if object_type == 'TemplateResponseDocumentStaticFieldText': + return import_module("dropbox_sign.models.template_response_document_static_field_text").TemplateResponseDocumentStaticFieldText.from_dict(obj) + + raise ValueError("TemplateResponseDocumentStaticFieldBase failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_static_field_checkbox.py b/dropbox_sign/models/template_response_document_static_field_checkbox.py new file mode 100644 index 0000000..855f4a2 --- /dev/null +++ b/dropbox_sign/models/template_response_document_static_field_checkbox.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldCheckbox(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldCheckbox from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldCheckbox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'checkbox', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_static_field_date_signed.py b/dropbox_sign/models/template_response_document_static_field_date_signed.py new file mode 100644 index 0000000..8006e77 --- /dev/null +++ b/dropbox_sign/models/template_response_document_static_field_date_signed.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldDateSigned(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldDateSigned from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldDateSigned from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'date_signed', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_static_field_dropdown.py b/dropbox_sign/models/template_response_document_static_field_dropdown.py new file mode 100644 index 0000000..efb9e48 --- /dev/null +++ b/dropbox_sign/models/template_response_document_static_field_dropdown.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldDropdown(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldDropdown from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldDropdown from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'dropdown', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_static_field_hyperlink.py b/dropbox_sign/models/template_response_document_static_field_hyperlink.py new file mode 100644 index 0000000..d84e557 --- /dev/null +++ b/dropbox_sign/models/template_response_document_static_field_hyperlink.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldHyperlink(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldHyperlink from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldHyperlink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'hyperlink', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_static_field_initials.py b/dropbox_sign/models/template_response_document_static_field_initials.py new file mode 100644 index 0000000..e06d739 --- /dev/null +++ b/dropbox_sign/models/template_response_document_static_field_initials.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldInitials(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldInitials from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldInitials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'initials', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_static_field_radio.py b/dropbox_sign/models/template_response_document_static_field_radio.py new file mode 100644 index 0000000..6a509ef --- /dev/null +++ b/dropbox_sign/models/template_response_document_static_field_radio.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldRadio(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldRadio from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldRadio from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'radio', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_static_field_signature.py b/dropbox_sign/models/template_response_document_static_field_signature.py new file mode 100644 index 0000000..08aaaaf --- /dev/null +++ b/dropbox_sign/models/template_response_document_static_field_signature.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldSignature(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldSignature from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldSignature from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'signature', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_document_static_field_text.py b/dropbox_sign/models/template_response_document_static_field_text.py new file mode 100644 index 0000000..380a7d5 --- /dev/null +++ b/dropbox_sign/models/template_response_document_static_field_text.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_response_document_static_field_base import TemplateResponseDocumentStaticFieldBase +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseDocumentStaticFieldText(TemplateResponseDocumentStaticFieldBase): + """ + This class extends `TemplateResponseDocumentStaticFieldBase` + """ # noqa: E501 + type: StrictStr = Field(description="The type of this static field. See [field types](/api/reference/constants/#field-types). * Text Field uses `TemplateResponseDocumentStaticFieldText` * Dropdown Field uses `TemplateResponseDocumentStaticFieldDropdown` * Hyperlink Field uses `TemplateResponseDocumentStaticFieldHyperlink` * Checkbox Field uses `TemplateResponseDocumentStaticFieldCheckbox` * Radio Field uses `TemplateResponseDocumentStaticFieldRadio` * Signature Field uses `TemplateResponseDocumentStaticFieldSignature` * Date Signed Field uses `TemplateResponseDocumentStaticFieldDateSigned` * Initials Field uses `TemplateResponseDocumentStaticFieldInitials`") + __properties: ClassVar[List[str]] = ["type", "api_id", "name", "signer", "x", "y", "width", "height", "required", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldText from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseDocumentStaticFieldText from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'text', + "api_id": obj.get("api_id"), + "name": obj.get("name"), + "signer": obj.get("signer") if obj.get("signer") is not None else 'me_now', + "x": obj.get("x"), + "y": obj.get("y"), + "width": obj.get("width"), + "height": obj.get("height"), + "required": obj.get("required"), + "group": obj.get("group") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "api_id": "(str,)", + "name": "(str,)", + "signer": "(str,)", + "x": "(int,)", + "y": "(int,)", + "width": "(int,)", + "height": "(int,)", + "required": "(bool,)", + "group": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_field_avg_text_length.py b/dropbox_sign/models/template_response_field_avg_text_length.py new file mode 100644 index 0000000..c53c9b2 --- /dev/null +++ b/dropbox_sign/models/template_response_field_avg_text_length.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseFieldAvgTextLength(BaseModel): + """ + Average text length in this field. + """ # noqa: E501 + num_lines: Optional[StrictInt] = Field(default=None, description="Number of lines.") + num_chars_per_line: Optional[StrictInt] = Field(default=None, description="Number of characters per line.") + __properties: ClassVar[List[str]] = ["num_lines", "num_chars_per_line"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseFieldAvgTextLength from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseFieldAvgTextLength from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "num_lines": obj.get("num_lines"), + "num_chars_per_line": obj.get("num_chars_per_line") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "num_lines": "(int,)", + "num_chars_per_line": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_response_signer_role.py b/dropbox_sign/models/template_response_signer_role.py new file mode 100644 index 0000000..45b77bb --- /dev/null +++ b/dropbox_sign/models/template_response_signer_role.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateResponseSignerRole(BaseModel): + """ + TemplateResponseSignerRole + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the Role.") + order: Optional[StrictInt] = Field(default=None, description="If signer order is assigned this is the 0-based index for this role.") + __properties: ClassVar[List[str]] = ["name", "order"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateResponseSignerRole from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateResponseSignerRole from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "order": obj.get("order") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "name": "(str,)", + "order": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_update_files_request.py b/dropbox_sign/models/template_update_files_request.py new file mode 100644 index 0000000..476e09b --- /dev/null +++ b/dropbox_sign/models/template_update_files_request.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateUpdateFilesRequest(BaseModel): + """ + TemplateUpdateFilesRequest + """ # noqa: E501 + client_id: Optional[StrictStr] = Field(default=None, description="Client id of the app you're using to update this template.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The new default template email message.") + subject: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="The new default template email subject.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + __properties: ClassVar[List[str]] = ["client_id", "files", "file_urls", "message", "subject", "test_mode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateUpdateFilesRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateUpdateFilesRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "message": obj.get("message"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "message": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + ] + diff --git a/dropbox_sign/models/template_update_files_response.py b/dropbox_sign/models/template_update_files_response.py new file mode 100644 index 0000000..2c2806a --- /dev/null +++ b/dropbox_sign/models/template_update_files_response.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from dropbox_sign.models.template_update_files_response_template import TemplateUpdateFilesResponseTemplate +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateUpdateFilesResponse(BaseModel): + """ + TemplateUpdateFilesResponse + """ # noqa: E501 + template: TemplateUpdateFilesResponseTemplate + __properties: ClassVar[List[str]] = ["template"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateUpdateFilesResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of template + if self.template: + _dict['template'] = self.template.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateUpdateFilesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template": TemplateUpdateFilesResponseTemplate.from_dict(obj["template"]) if obj.get("template") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template": "(TemplateUpdateFilesResponseTemplate,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/template_update_files_response_template.py b/dropbox_sign/models/template_update_files_response_template.py new file mode 100644 index 0000000..0add592 --- /dev/null +++ b/dropbox_sign/models/template_update_files_response_template.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class TemplateUpdateFilesResponseTemplate(BaseModel): + """ + Contains template id + """ # noqa: E501 + template_id: Optional[StrictStr] = Field(default=None, description="The id of the Template.") + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["template_id", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateUpdateFilesResponseTemplate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateUpdateFilesResponseTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template_id": obj.get("template_id"), + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "template_id": "(str,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/unclaimed_draft_create_embedded_request.py b/dropbox_sign/models/unclaimed_draft_create_embedded_request.py new file mode 100644 index 0000000..187b4c1 --- /dev/null +++ b/dropbox_sign/models/unclaimed_draft_create_embedded_request.py @@ -0,0 +1,306 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from dropbox_sign.models.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class UnclaimedDraftCreateEmbeddedRequest(BaseModel): + """ + + """ # noqa: E501 + client_id: StrictStr = Field(description="Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") + requester_email_address: StrictStr = Field(description="The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + allow_ccs: Optional[StrictBool] = Field(default=True, description="This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="The email addresses that should be CCed.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + editor_options: Optional[SubEditorOptions] = None + field_options: Optional[SubFieldOptions] = None + force_signer_page: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the signers.") + force_subject_message: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the subject and message.") + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field(default=None, description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + hide_text_tags: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.") + hold_request: Optional[StrictBool] = Field(default=False, description="The request from this draft will not automatically send to signers post-claim if set to `true`. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.") + is_for_embedded_signing: Optional[StrictBool] = Field(default=False, description="The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + requesting_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully request a signature.") + show_preview: Optional[StrictBool] = Field(default=None, description="This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + signers: Optional[List[SubUnclaimedDraftSigner]] = Field(default=None, description="Add Signers to your Unclaimed Draft Signature Request.") + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + skip_me_now: Optional[StrictBool] = Field(default=False, description="Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") + subject: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + type: Optional[StrictStr] = Field(default='request_signature', description="The type of the draft. By default this is `request_signature`, but you can set it to `send_document` if you want to self sign a document and download it.") + use_preexisting_fields: Optional[StrictBool] = Field(default=False, description="Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") + use_text_tags: Optional[StrictBool] = Field(default=False, description="Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") + populate_auto_fill_fields: Optional[StrictBool] = Field(default=False, description="Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") + expires_at: Optional[StrictInt] = Field(default=None, description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.") + __properties: ClassVar[List[str]] = ["client_id", "requester_email_address", "files", "file_urls", "allow_ccs", "allow_decline", "allow_reassign", "attachments", "cc_email_addresses", "custom_fields", "editor_options", "field_options", "force_signer_page", "force_subject_message", "form_field_groups", "form_field_rules", "form_fields_per_document", "hide_text_tags", "hold_request", "is_for_embedded_signing", "message", "metadata", "requesting_redirect_url", "show_preview", "show_progress_stepper", "signers", "signing_options", "signing_redirect_url", "skip_me_now", "subject", "test_mode", "type", "use_preexisting_fields", "use_text_tags", "populate_auto_fill_fields", "expires_at"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['send_document', 'request_signature']): + raise ValueError("must be one of enum values ('send_document', 'request_signature')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateEmbeddedRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of editor_options + if self.editor_options: + _dict['editor_options'] = self.editor_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateEmbeddedRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "requester_email_address": obj.get("requester_email_address"), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "allow_ccs": obj.get("allow_ccs") if obj.get("allow_ccs") is not None else True, + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_email_addresses": obj.get("cc_email_addresses"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "editor_options": SubEditorOptions.from_dict(obj["editor_options"]) if obj.get("editor_options") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "force_signer_page": obj.get("force_signer_page") if obj.get("force_signer_page") is not None else False, + "force_subject_message": obj.get("force_subject_message") if obj.get("force_subject_message") is not None else False, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "hide_text_tags": obj.get("hide_text_tags") if obj.get("hide_text_tags") is not None else False, + "hold_request": obj.get("hold_request") if obj.get("hold_request") is not None else False, + "is_for_embedded_signing": obj.get("is_for_embedded_signing") if obj.get("is_for_embedded_signing") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "requesting_redirect_url": obj.get("requesting_redirect_url"), + "show_preview": obj.get("show_preview"), + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "signers": [SubUnclaimedDraftSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "signing_redirect_url": obj.get("signing_redirect_url"), + "skip_me_now": obj.get("skip_me_now") if obj.get("skip_me_now") is not None else False, + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "type": obj.get("type") if obj.get("type") is not None else 'request_signature', + "use_preexisting_fields": obj.get("use_preexisting_fields") if obj.get("use_preexisting_fields") is not None else False, + "use_text_tags": obj.get("use_text_tags") if obj.get("use_text_tags") is not None else False, + "populate_auto_fill_fields": obj.get("populate_auto_fill_fields") if obj.get("populate_auto_fill_fields") is not None else False, + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "requester_email_address": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "allow_ccs": "(bool,)", + "allow_decline": "(bool,)", + "allow_reassign": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_email_addresses": "(List[str],)", + "custom_fields": "(List[SubCustomField],)", + "editor_options": "(SubEditorOptions,)", + "field_options": "(SubFieldOptions,)", + "force_signer_page": "(bool,)", + "force_subject_message": "(bool,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "hide_text_tags": "(bool,)", + "hold_request": "(bool,)", + "is_for_embedded_signing": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "requesting_redirect_url": "(str,)", + "show_preview": "(bool,)", + "show_progress_stepper": "(bool,)", + "signers": "(List[SubUnclaimedDraftSigner],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "skip_me_now": "(bool,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "type": "(str,)", + "use_preexisting_fields": "(bool,)", + "use_text_tags": "(bool,)", + "populate_auto_fill_fields": "(bool,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "attachments", + "cc_email_addresses", + "custom_fields", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + "signers", + ] + diff --git a/dropbox_sign/models/unclaimed_draft_create_embedded_with_template_request.py b/dropbox_sign/models/unclaimed_draft_create_embedded_with_template_request.py new file mode 100644 index 0000000..1b9dd8b --- /dev/null +++ b/dropbox_sign/models/unclaimed_draft_create_embedded_with_template_request.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_cc import SubCC +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from dropbox_sign.models.sub_unclaimed_draft_template_signer import SubUnclaimedDraftTemplateSigner +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class UnclaimedDraftCreateEmbeddedWithTemplateRequest(BaseModel): + """ + UnclaimedDraftCreateEmbeddedWithTemplateRequest + """ # noqa: E501 + client_id: StrictStr = Field(description="Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") + requester_email_address: StrictStr = Field(description="The email address of the user that should be designated as the requester of this draft.") + template_ids: List[StrictStr] = Field(description="Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + allow_reassign: Optional[StrictBool] = Field(default=False, description="Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan and higher.") + ccs: Optional[List[SubCC]] = Field(default=None, description="Add CC email recipients. Required when a CC role exists for the Template.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="An array defining values and options for custom fields. Required when a custom field exists in the Template.") + editor_options: Optional[SubEditorOptions] = None + field_options: Optional[SubFieldOptions] = None + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to append additional files to the signature request being created from the template. Dropbox Sign will parse the files for [text tags](https://app.hellosign.com/api/textTagsWalkthrough) and append it to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use file_urls[] to append additional files to the signature request being created from the template. Dropbox Sign will download the file, then parse it for [text tags](https://app.hellosign.com/api/textTagsWalkthrough), and append to the signature request. Text tags for signers not on the template(s) will be ignored. **files** or **file_urls[]** is required, but not both.") + force_signer_roles: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template signer roles.") + force_subject_message: Optional[StrictBool] = Field(default=False, description="Provide users the ability to review/edit the template subject and message.") + hold_request: Optional[StrictBool] = Field(default=False, description="The request from this draft will not automatically send to signers post-claim if set to 1. Requester must [release](/api/reference/operation/signatureRequestReleaseHold/) the request from hold when ready to send. Defaults to `false`.") + is_for_embedded_signing: Optional[StrictBool] = Field(default=False, description="The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + preview_only: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable the preview experience (i.e. does not allow the requester's end user to add any additional fields via the editor). - `preview_only=true`: Allows requesters to enable the preview only experience. - `preview_only=false`: Allows requesters to disable the preview only experience. **NOTE:** This parameter overwrites `show_preview=1` (if set).") + requesting_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully request a signature.") + show_preview: Optional[StrictBool] = Field(default=False, description="This allows the requester to enable the editor/preview experience. - `show_preview=true`: Allows requesters to enable the editor/preview experience. - `show_preview=false`: Allows requesters to disable the editor/preview experience.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + signers: Optional[List[SubUnclaimedDraftTemplateSigner]] = Field(default=None, description="Add Signers to your Templated-based Signature Request.") + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + skip_me_now: Optional[StrictBool] = Field(default=False, description="Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`.") + subject: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The title you want to assign to the SignatureRequest.") + populate_auto_fill_fields: Optional[StrictBool] = Field(default=False, description="Controls whether [auto fill fields](https://faq.hellosign.com/hc/en-us/articles/360051467511-Auto-Fill-Fields) can automatically populate a signer's information during signing. **NOTE:** Keep your signer's information safe by ensuring that the _signer on your signature request is the intended party_ before using this feature.") + allow_ccs: Optional[StrictBool] = Field(default=False, description="This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft.") + __properties: ClassVar[List[str]] = ["client_id", "requester_email_address", "template_ids", "allow_decline", "allow_reassign", "ccs", "custom_fields", "editor_options", "field_options", "files", "file_urls", "force_signer_roles", "force_subject_message", "hold_request", "is_for_embedded_signing", "message", "metadata", "preview_only", "requesting_redirect_url", "show_preview", "show_progress_stepper", "signers", "signing_options", "signing_redirect_url", "skip_me_now", "subject", "test_mode", "title", "populate_auto_fill_fields", "allow_ccs"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateEmbeddedWithTemplateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in ccs (list) + _items = [] + if self.ccs: + for _item_ccs in self.ccs: + if _item_ccs: + _items.append(_item_ccs.to_dict()) + _dict['ccs'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of editor_options + if self.editor_options: + _dict['editor_options'] = self.editor_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateEmbeddedWithTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "requester_email_address": obj.get("requester_email_address"), + "template_ids": obj.get("template_ids"), + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "allow_reassign": obj.get("allow_reassign") if obj.get("allow_reassign") is not None else False, + "ccs": [SubCC.from_dict(_item) for _item in obj["ccs"]] if obj.get("ccs") is not None else None, + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "editor_options": SubEditorOptions.from_dict(obj["editor_options"]) if obj.get("editor_options") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "force_signer_roles": obj.get("force_signer_roles") if obj.get("force_signer_roles") is not None else False, + "force_subject_message": obj.get("force_subject_message") if obj.get("force_subject_message") is not None else False, + "hold_request": obj.get("hold_request") if obj.get("hold_request") is not None else False, + "is_for_embedded_signing": obj.get("is_for_embedded_signing") if obj.get("is_for_embedded_signing") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "preview_only": obj.get("preview_only") if obj.get("preview_only") is not None else False, + "requesting_redirect_url": obj.get("requesting_redirect_url"), + "show_preview": obj.get("show_preview") if obj.get("show_preview") is not None else False, + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "signers": [SubUnclaimedDraftTemplateSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "signing_redirect_url": obj.get("signing_redirect_url"), + "skip_me_now": obj.get("skip_me_now") if obj.get("skip_me_now") is not None else False, + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "title": obj.get("title"), + "populate_auto_fill_fields": obj.get("populate_auto_fill_fields") if obj.get("populate_auto_fill_fields") is not None else False, + "allow_ccs": obj.get("allow_ccs") if obj.get("allow_ccs") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "requester_email_address": "(str,)", + "template_ids": "(List[str],)", + "allow_decline": "(bool,)", + "allow_reassign": "(bool,)", + "ccs": "(List[SubCC],)", + "custom_fields": "(List[SubCustomField],)", + "editor_options": "(SubEditorOptions,)", + "field_options": "(SubFieldOptions,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "force_signer_roles": "(bool,)", + "force_subject_message": "(bool,)", + "hold_request": "(bool,)", + "is_for_embedded_signing": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "preview_only": "(bool,)", + "requesting_redirect_url": "(str,)", + "show_preview": "(bool,)", + "show_progress_stepper": "(bool,)", + "signers": "(List[SubUnclaimedDraftTemplateSigner],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "skip_me_now": "(bool,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "title": "(str,)", + "populate_auto_fill_fields": "(bool,)", + "allow_ccs": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "template_ids", + "ccs", + "custom_fields", + "files", + "file_urls", + "signers", + ] + diff --git a/dropbox_sign/models/unclaimed_draft_create_request.py b/dropbox_sign/models/unclaimed_draft_create_request.py new file mode 100644 index 0000000..c685111 --- /dev/null +++ b/dropbox_sign/models/unclaimed_draft_create_request.py @@ -0,0 +1,263 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from dropbox_sign.models.sub_attachment import SubAttachment +from dropbox_sign.models.sub_custom_field import SubCustomField +from dropbox_sign.models.sub_field_options import SubFieldOptions +from dropbox_sign.models.sub_form_field_group import SubFormFieldGroup +from dropbox_sign.models.sub_form_field_rule import SubFormFieldRule +from dropbox_sign.models.sub_form_fields_per_document_base import SubFormFieldsPerDocumentBase +from dropbox_sign.models.sub_signing_options import SubSigningOptions +from dropbox_sign.models.sub_unclaimed_draft_signer import SubUnclaimedDraftSigner +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class UnclaimedDraftCreateRequest(BaseModel): + """ + + """ # noqa: E501 + type: StrictStr = Field(description="The type of unclaimed draft to create. Use `send_document` to create a claimable file, and `request_signature` for a claimable signature request. If the type is `request_signature` then signers name and email_address are not optional.") + files: Optional[List[Union[StrictBytes, StrictStr, io.IOBase]]] = Field(default=None, description="Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + file_urls: Optional[List[StrictStr]] = Field(default=None, description="Use `file_urls[]` to have Dropbox Sign download the file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both.") + allow_decline: Optional[StrictBool] = Field(default=False, description="Allows signers to decline to sign a document if `true`. Defaults to `false`.") + attachments: Optional[List[SubAttachment]] = Field(default=None, description="A list describing the attachments") + cc_email_addresses: Optional[List[StrictStr]] = Field(default=None, description="The email addresses that should be CCed.") + client_id: Optional[StrictStr] = Field(default=None, description="Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") + custom_fields: Optional[List[SubCustomField]] = Field(default=None, description="When used together with merge fields, `custom_fields` allows users to add pre-filled data to their signature requests. Pre-filled data can be used with \"send-once\" signature requests by adding merge fields with `form_fields_per_document` or [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) while passing values back with `custom_fields` together in one API call. For using pre-filled on repeatable signature requests, merge fields are added to templates in the Dropbox Sign UI or by calling [/template/create_embedded_draft](/api/reference/operation/templateCreateEmbeddedDraft) and then passing `custom_fields` on subsequent signature requests referencing that template.") + field_options: Optional[SubFieldOptions] = None + form_field_groups: Optional[List[SubFormFieldGroup]] = Field(default=None, description="Group information for fields defined in `form_fields_per_document`. String-indexed JSON array with `group_label` and `requirement` keys. `form_fields_per_document` must contain fields referencing a group defined in `form_field_groups`.") + form_field_rules: Optional[List[SubFormFieldRule]] = Field(default=None, description="Conditional Logic rules for fields defined in `form_fields_per_document`.") + form_fields_per_document: Optional[List[SubFormFieldsPerDocumentBase]] = Field(default=None, description="The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE:** Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`") + hide_text_tags: Optional[StrictBool] = Field(default=False, description="Send with a value of `true` if you wish to enable automatic Text Tag removal. Defaults to `false`. When using Text Tags it is preferred that you set this to `false` and hide your tags with white text or something similar because the automatic removal system can cause unwanted clipping. See the [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) walkthrough for more details.") + message: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = Field(default=None, description="The custom message in the email that will be sent to the signers.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Key-value data that should be attached to the signature request. This metadata is included in all API responses and events involving the signature request. For example, use the metadata field to store a signer's order number for look up when receiving events for the signature request. Each request can include up to 10 metadata keys (or 50 nested metadata keys), with key names up to 40 characters long and values up to 1000 characters long.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + signers: Optional[List[SubUnclaimedDraftSigner]] = Field(default=None, description="Add Signers to your Unclaimed Draft Signature Request.") + signing_options: Optional[SubSigningOptions] = None + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + subject: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="The subject in the email that will be sent to the signers.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + use_preexisting_fields: Optional[StrictBool] = Field(default=False, description="Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") + use_text_tags: Optional[StrictBool] = Field(default=False, description="Set `use_text_tags` to `true` to enable [Text Tags](https://app.hellosign.com/api/textTagsWalkthrough#TextTagIntro) parsing in your document (defaults to disabled, or `false`). Alternatively, if your PDF contains pre-defined fields, enable the detection of these fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). Currently we only support use of either `use_text_tags` or `use_preexisting_fields` parameter, not both.") + expires_at: Optional[StrictInt] = Field(default=None, description="When the signature request will expire. Unsigned signatures will be moved to the expired status, and no longer signable. See [Signature Request Expiration Date](https://developers.hellosign.com/docs/signature-request/expiration/) for details. **NOTE:** This does not correspond to the **expires_at** returned in the response.") + __properties: ClassVar[List[str]] = ["type", "files", "file_urls", "allow_decline", "attachments", "cc_email_addresses", "client_id", "custom_fields", "field_options", "form_field_groups", "form_field_rules", "form_fields_per_document", "hide_text_tags", "message", "metadata", "show_progress_stepper", "signers", "signing_options", "signing_redirect_url", "subject", "test_mode", "use_preexisting_fields", "use_text_tags", "expires_at"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['send_document', 'request_signature']): + raise ValueError("must be one of enum values ('send_document', 'request_signature')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of field_options + if self.field_options: + _dict['field_options'] = self.field_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in form_field_groups (list) + _items = [] + if self.form_field_groups: + for _item_form_field_groups in self.form_field_groups: + if _item_form_field_groups: + _items.append(_item_form_field_groups.to_dict()) + _dict['form_field_groups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_field_rules (list) + _items = [] + if self.form_field_rules: + for _item_form_field_rules in self.form_field_rules: + if _item_form_field_rules: + _items.append(_item_form_field_rules.to_dict()) + _dict['form_field_rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in form_fields_per_document (list) + _items = [] + if self.form_fields_per_document: + for _item_form_fields_per_document in self.form_fields_per_document: + if _item_form_fields_per_document: + _items.append(_item_form_fields_per_document.to_dict()) + _dict['form_fields_per_document'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in signers (list) + _items = [] + if self.signers: + for _item_signers in self.signers: + if _item_signers: + _items.append(_item_signers.to_dict()) + _dict['signers'] = _items + # override the default output from pydantic by calling `to_dict()` of signing_options + if self.signing_options: + _dict['signing_options'] = self.signing_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "files": obj.get("files"), + "file_urls": obj.get("file_urls"), + "allow_decline": obj.get("allow_decline") if obj.get("allow_decline") is not None else False, + "attachments": [SubAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "cc_email_addresses": obj.get("cc_email_addresses"), + "client_id": obj.get("client_id"), + "custom_fields": [SubCustomField.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None, + "field_options": SubFieldOptions.from_dict(obj["field_options"]) if obj.get("field_options") is not None else None, + "form_field_groups": [SubFormFieldGroup.from_dict(_item) for _item in obj["form_field_groups"]] if obj.get("form_field_groups") is not None else None, + "form_field_rules": [SubFormFieldRule.from_dict(_item) for _item in obj["form_field_rules"]] if obj.get("form_field_rules") is not None else None, + "form_fields_per_document": [SubFormFieldsPerDocumentBase.from_dict(_item) for _item in obj["form_fields_per_document"]] if obj.get("form_fields_per_document") is not None else None, + "hide_text_tags": obj.get("hide_text_tags") if obj.get("hide_text_tags") is not None else False, + "message": obj.get("message"), + "metadata": obj.get("metadata"), + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "signers": [SubUnclaimedDraftSigner.from_dict(_item) for _item in obj["signers"]] if obj.get("signers") is not None else None, + "signing_options": SubSigningOptions.from_dict(obj["signing_options"]) if obj.get("signing_options") is not None else None, + "signing_redirect_url": obj.get("signing_redirect_url"), + "subject": obj.get("subject"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False, + "use_preexisting_fields": obj.get("use_preexisting_fields") if obj.get("use_preexisting_fields") is not None else False, + "use_text_tags": obj.get("use_text_tags") if obj.get("use_text_tags") is not None else False, + "expires_at": obj.get("expires_at") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "type": "(str,)", + "files": "(List[io.IOBase],)", + "file_urls": "(List[str],)", + "allow_decline": "(bool,)", + "attachments": "(List[SubAttachment],)", + "cc_email_addresses": "(List[str],)", + "client_id": "(str,)", + "custom_fields": "(List[SubCustomField],)", + "field_options": "(SubFieldOptions,)", + "form_field_groups": "(List[SubFormFieldGroup],)", + "form_field_rules": "(List[SubFormFieldRule],)", + "form_fields_per_document": "(List[SubFormFieldsPerDocumentBase],)", + "hide_text_tags": "(bool,)", + "message": "(str,)", + "metadata": "(Dict[str, object],)", + "show_progress_stepper": "(bool,)", + "signers": "(List[SubUnclaimedDraftSigner],)", + "signing_options": "(SubSigningOptions,)", + "signing_redirect_url": "(str,)", + "subject": "(str,)", + "test_mode": "(bool,)", + "use_preexisting_fields": "(bool,)", + "use_text_tags": "(bool,)", + "expires_at": "(int,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "files", + "file_urls", + "attachments", + "cc_email_addresses", + "custom_fields", + "form_field_groups", + "form_field_rules", + "form_fields_per_document", + "signers", + ] + diff --git a/dropbox_sign/models/unclaimed_draft_create_response.py b/dropbox_sign/models/unclaimed_draft_create_response.py new file mode 100644 index 0000000..0ec98ba --- /dev/null +++ b/dropbox_sign/models/unclaimed_draft_create_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.unclaimed_draft_response import UnclaimedDraftResponse +from dropbox_sign.models.warning_response import WarningResponse +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class UnclaimedDraftCreateResponse(BaseModel): + """ + UnclaimedDraftCreateResponse + """ # noqa: E501 + unclaimed_draft: UnclaimedDraftResponse + warnings: Optional[List[WarningResponse]] = Field(default=None, description="A list of warnings.") + __properties: ClassVar[List[str]] = ["unclaimed_draft", "warnings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of unclaimed_draft + if self.unclaimed_draft: + _dict['unclaimed_draft'] = self.unclaimed_draft.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in warnings (list) + _items = [] + if self.warnings: + for _item_warnings in self.warnings: + if _item_warnings: + _items.append(_item_warnings.to_dict()) + _dict['warnings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnclaimedDraftCreateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "unclaimed_draft": UnclaimedDraftResponse.from_dict(obj["unclaimed_draft"]) if obj.get("unclaimed_draft") is not None else None, + "warnings": [WarningResponse.from_dict(_item) for _item in obj["warnings"]] if obj.get("warnings") is not None else None + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "unclaimed_draft": "(UnclaimedDraftResponse,)", + "warnings": "(List[WarningResponse],)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + "warnings", + ] + diff --git a/dropbox_sign/models/unclaimed_draft_edit_and_resend_request.py b/dropbox_sign/models/unclaimed_draft_edit_and_resend_request.py new file mode 100644 index 0000000..615828f --- /dev/null +++ b/dropbox_sign/models/unclaimed_draft_edit_and_resend_request.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from dropbox_sign.models.sub_editor_options import SubEditorOptions +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class UnclaimedDraftEditAndResendRequest(BaseModel): + """ + UnclaimedDraftEditAndResendRequest + """ # noqa: E501 + client_id: StrictStr = Field(description="Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app.") + editor_options: Optional[SubEditorOptions] = None + is_for_embedded_signing: Optional[StrictBool] = Field(default=None, description="The request created from this draft will also be signable in embedded mode if set to `true`.") + requester_email_address: Optional[StrictStr] = Field(default=None, description="The email address of the user that should be designated as the requester of this draft. If not set, original requester's email address will be used.") + requesting_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully request a signature.") + show_progress_stepper: Optional[StrictBool] = Field(default=True, description="When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + test_mode: Optional[StrictBool] = Field(default=False, description="Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`.") + __properties: ClassVar[List[str]] = ["client_id", "editor_options", "is_for_embedded_signing", "requester_email_address", "requesting_redirect_url", "show_progress_stepper", "signing_redirect_url", "test_mode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnclaimedDraftEditAndResendRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of editor_options + if self.editor_options: + _dict['editor_options'] = self.editor_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnclaimedDraftEditAndResendRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_id": obj.get("client_id"), + "editor_options": SubEditorOptions.from_dict(obj["editor_options"]) if obj.get("editor_options") is not None else None, + "is_for_embedded_signing": obj.get("is_for_embedded_signing"), + "requester_email_address": obj.get("requester_email_address"), + "requesting_redirect_url": obj.get("requesting_redirect_url"), + "show_progress_stepper": obj.get("show_progress_stepper") if obj.get("show_progress_stepper") is not None else True, + "signing_redirect_url": obj.get("signing_redirect_url"), + "test_mode": obj.get("test_mode") if obj.get("test_mode") is not None else False + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "client_id": "(str,)", + "editor_options": "(SubEditorOptions,)", + "is_for_embedded_signing": "(bool,)", + "requester_email_address": "(str,)", + "requesting_redirect_url": "(str,)", + "show_progress_stepper": "(bool,)", + "signing_redirect_url": "(str,)", + "test_mode": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/unclaimed_draft_response.py b/dropbox_sign/models/unclaimed_draft_response.py new file mode 100644 index 0000000..7f4c72a --- /dev/null +++ b/dropbox_sign/models/unclaimed_draft_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class UnclaimedDraftResponse(BaseModel): + """ + A group of documents that a user can take ownership of via the claim URL. + """ # noqa: E501 + signature_request_id: Optional[StrictStr] = Field(default=None, description="The ID of the signature request that is represented by this UnclaimedDraft.") + claim_url: Optional[StrictStr] = Field(default=None, description="The URL to be used to claim this UnclaimedDraft.") + signing_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully sign.") + requesting_redirect_url: Optional[StrictStr] = Field(default=None, description="The URL you want signers redirected to after they successfully request a signature (Will only be returned in the response if it is applicable to the request.).") + expires_at: Optional[StrictInt] = Field(default=None, description="When the link expires.") + test_mode: Optional[StrictBool] = Field(default=None, description="Whether this is a test draft. Signature requests made from test drafts have no legal value.") + __properties: ClassVar[List[str]] = ["signature_request_id", "claim_url", "signing_redirect_url", "requesting_redirect_url", "expires_at", "test_mode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnclaimedDraftResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnclaimedDraftResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "signature_request_id": obj.get("signature_request_id"), + "claim_url": obj.get("claim_url"), + "signing_redirect_url": obj.get("signing_redirect_url"), + "requesting_redirect_url": obj.get("requesting_redirect_url"), + "expires_at": obj.get("expires_at"), + "test_mode": obj.get("test_mode") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "signature_request_id": "(str,)", + "claim_url": "(str,)", + "signing_redirect_url": "(str,)", + "requesting_redirect_url": "(str,)", + "expires_at": "(int,)", + "test_mode": "(bool,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/models/warning_response.py b/dropbox_sign/models/warning_response.py new file mode 100644 index 0000000..3524ace --- /dev/null +++ b/dropbox_sign/models/warning_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Dropbox Sign API + + Dropbox Sign v3 API + + The version of the OpenAPI document: 3.0.0 + Contact: apisupport@hellosign.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set, Tuple +from typing_extensions import Self +import io +from pydantic import StrictBool +from typing import Union + +class WarningResponse(BaseModel): + """ + A list of warnings. + """ # noqa: E501 + warning_msg: StrictStr = Field(description="Warning message") + warning_name: StrictStr = Field(description="Warning name") + __properties: ClassVar[List[str]] = ["warning_msg", "warning_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + arbitrary_types_allowed=True, + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WarningResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WarningResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "warning_msg": obj.get("warning_msg"), + "warning_name": obj.get("warning_name") + }) + return _obj + + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { + "warning_msg": "(str,)", + "warning_name": "(str,)", + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + ] + diff --git a/dropbox_sign/py.typed b/dropbox_sign/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/dropbox_sign/rest.py b/dropbox_sign/rest.py index 4f01302..0c57b2c 100644 --- a/dropbox_sign/rest.py +++ b/dropbox_sign/rest.py @@ -1,55 +1,69 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import io import json -import logging import re import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment + import urllib3 -import ipaddress -from dropbox_sign.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from dropbox_sign.exceptions import ApiException, ApiValueError +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -58,70 +72,79 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager - if configuration.proxy and not should_bypass_proxies(configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -133,60 +156,83 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', headers['Content-Type'], re.IGNORECASE)): + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -197,151 +243,16 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None , '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ',''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} ) + return RESTResponse(r) diff --git a/examples/FaxLineAddUser.py b/examples/FaxLineAddUser.py new file mode 100644 index 0000000..49d362c --- /dev/null +++ b/examples/FaxLineAddUser.py @@ -0,0 +1,23 @@ +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineAddUserRequest( + number="[FAX_NUMBER]", + email_address="member@dropboxsign.com", + ) + + try: + response = fax_line_api.fax_line_add_user(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineAreaCodeGet.py b/examples/FaxLineAreaCodeGet.py new file mode 100644 index 0000000..8a46373 --- /dev/null +++ b/examples/FaxLineAreaCodeGet.py @@ -0,0 +1,18 @@ +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_area_code_get("US", "CA") + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineCreate.py b/examples/FaxLineCreate.py new file mode 100644 index 0000000..14ef9c9 --- /dev/null +++ b/examples/FaxLineCreate.py @@ -0,0 +1,23 @@ +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineCreateRequest( + area_code=209, + country="US", + ) + + try: + response = fax_line_api.fax_line_create(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineDelete.py b/examples/FaxLineDelete.py new file mode 100644 index 0000000..7b828b0 --- /dev/null +++ b/examples/FaxLineDelete.py @@ -0,0 +1,21 @@ +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineDeleteRequest( + number="[FAX_NUMBER]", + ) + + try: + fax_line_api.fax_line_delete(data) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineGet.py b/examples/FaxLineGet.py new file mode 100644 index 0000000..3f66de9 --- /dev/null +++ b/examples/FaxLineGet.py @@ -0,0 +1,18 @@ +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_get("[FAX_NUMBER]") + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineList.py b/examples/FaxLineList.py new file mode 100644 index 0000000..49cf69a --- /dev/null +++ b/examples/FaxLineList.py @@ -0,0 +1,18 @@ +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + try: + response = fax_line_api.fax_line_list() + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/FaxLineRemoveUser.py b/examples/FaxLineRemoveUser.py new file mode 100644 index 0000000..4d8c196 --- /dev/null +++ b/examples/FaxLineRemoveUser.py @@ -0,0 +1,23 @@ +from pprint import pprint + +from dropbox_sign import \ + ApiClient, ApiException, Configuration, apis, models + +configuration = Configuration( + # Configure HTTP basic authorization: api_key + username="YOUR_API_KEY", +) + +with ApiClient(configuration) as api_client: + fax_line_api = apis.FaxLineApi(api_client) + + data = models.FaxLineRemoveUserRequest( + number="[FAX_NUMBER]", + email_address="member@dropboxsign.com", + ) + + try: + response = fax_line_api.fax_line_remove_user(data) + pprint(response) + except ApiException as e: + print("Exception when calling Dropbox Sign API: %s\n" % e) diff --git a/examples/OauthTokenGenerate.py b/examples/OauthTokenGenerate.py index 2d77a4c..c8fd0bd 100644 --- a/examples/OauthTokenGenerate.py +++ b/examples/OauthTokenGenerate.py @@ -6,7 +6,7 @@ configuration = Configuration() with ApiClient(configuration) as api_client: - api = apis.OAuthApi(api_client) + oauth_api = apis.OAuthApi(api_client) data = models.OAuthTokenGenerateRequest( state="900e06e2", diff --git a/examples/OauthTokenRefresh.py b/examples/OauthTokenRefresh.py index 9d11f4d..832bbaf 100644 --- a/examples/OauthTokenRefresh.py +++ b/examples/OauthTokenRefresh.py @@ -6,7 +6,7 @@ configuration = Configuration() with ApiClient(configuration) as api_client: - api = apis.OAuthApi(api_client) + oauth_api = apis.OAuthApi(api_client) data = models.OAuthTokenRefreshRequest( refresh_token="hNTI2MTFmM2VmZDQxZTZjOWRmZmFjZmVmMGMyNGFjMzI2MGI5YzgzNmE3", diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/openapi-config.yaml b/openapi-config.yaml index 6e10988..d768a53 100644 --- a/openapi-config.yaml +++ b/openapi-config.yaml @@ -1,16 +1,21 @@ generatorName: python -typeMappings: {} +typeMappings: + "bytearray": "io.IOBase" additionalProperties: generatorLanguageVersion: ">=3.7" packageName: dropbox_sign projectName: dropbox-sign - packageVersion: 1.5.0 + packageVersion: 1.6.0 sortModelPropertiesByRequiredFlag: true legacyDiscriminatorBehavior: true packageAuthor: Dropbox Sign API Team packageUrl: https://github.com/hellosign/dropbox-sign-python infoName: Official Python SDK for the Dropbox Sign API + useCustomTemplateCode: true files: + __init__apis.mustache: + templateType: SupportingFiles + destinationFilename: dropbox_sign/apis/__init__.py event_callback_helper.mustache: templateType: SupportingFiles destinationFilename: dropbox_sign/event_callback_helper.py diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index 9bf5a68..c7189fd 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -1409,6 +1409,803 @@ paths: seo: title: 'Get Embedded Sign URL | iFrame | Dropbox Sign for Developers' description: 'The Dropbox Sign API allows you to build custom integrations. To find out how to retrieve an embedded iFrame object containing a signature url, click here.' + /fax_line/add_user: + put: + tags: + - 'Fax Line' + summary: 'Add Fax Line User' + description: 'Grants a user access to the specified Fax Line.' + operationId: faxLineAddUser + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineAddUserRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineAddUserRequestExample' + responses: + 200: + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineAddUser.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineAddUser.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineAddUser.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineAddUser.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineAddUser.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineAddUser.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineAddUser.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineAddUser.sh + x-meta: + seo: + title: 'Fax Line Add User | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to add a user to an existing fax line, click here.' + /fax_line/area_codes: + get: + tags: + - 'Fax Line' + summary: 'Get Available Fax Line Area Codes' + description: 'Returns a response with the area codes available for a given state/provice and city.' + operationId: faxLineAreaCodeGet + parameters: + - + name: country + in: query + description: 'Filter area codes by country.' + required: true + schema: + type: string + enum: + - CA + - US + - UK + - + name: state + in: query + description: 'Filter area codes by state.' + schema: + type: string + enum: + - AK + - AL + - AR + - AZ + - CA + - CO + - CT + - DC + - DE + - FL + - GA + - HI + - IA + - ID + - IL + - IN + - KS + - KY + - LA + - MA + - MD + - ME + - MI + - MN + - MO + - MS + - MT + - NC + - ND + - NE + - NH + - NJ + - NM + - NV + - NY + - OH + - OK + - OR + - PA + - RI + - SC + - SD + - TN + - TX + - UT + - VA + - VT + - WA + - WI + - WV + - WY + - + name: province + in: query + description: 'Filter area codes by province.' + schema: + type: string + enum: + - AB + - BC + - MB + - NB + - NL + - NT + - NS + - NU + - 'ON' + - PE + - QC + - SK + - YT + - + name: city + in: query + description: 'Filter area codes by city.' + schema: + type: string + responses: + 200: + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineAreaCodeGetResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineAreaCodeGetResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineAreaCodeGet.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineAreaCodeGet.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineAreaCodeGet.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineAreaCodeGet.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineAreaCodeGet.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineAreaCodeGet.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineAreaCodeGet.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineAreaCodeGet.sh + x-meta: + seo: + title: 'Fax Line Get Area Codes | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to purchase a new fax line, click here.' + /fax_line/create: + post: + tags: + - 'Fax Line' + summary: 'Purchase Fax Line' + description: 'Purchases a new Fax Line.' + operationId: faxLineCreate + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineCreateRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineCreateRequestExample' + responses: + 200: + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineCreate.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineCreate.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineCreate.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineCreate.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineCreate.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineCreate.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineCreate.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineCreate.sh + x-meta: + seo: + title: 'Purchase Fax Line | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to purchase a new fax line, click here.' + /fax_line: + get: + tags: + - 'Fax Line' + summary: 'Get Fax Line' + description: 'Returns the properties and settings of a Fax Line.' + operationId: faxLineGet + parameters: + - + name: number + in: query + description: 'The Fax Line number.' + required: true + schema: + type: string + responses: + 200: + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineGet.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineGet.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineGet.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineGet.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineGet.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineGet.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineGet.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineGet.sh + x-meta: + seo: + title: 'Get Fax Line | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to retrieve a fax line, click here.' + delete: + tags: + - 'Fax Line' + summary: 'Delete Fax Line' + description: 'Deletes the specified Fax Line from the subscription.' + operationId: faxLineDelete + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineDeleteRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineDeleteRequestExample' + responses: + 200: + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: {} + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineDelete.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineDelete.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineDelete.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineDelete.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineDelete.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineDelete.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineDelete.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineDelete.sh + x-meta: + seo: + title: 'Delete Fax Line | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to delete a fax line, click here.' + /fax_line/list: + get: + tags: + - 'Fax Line' + summary: 'List Fax Lines' + description: 'Returns the properties and settings of multiple Fax Lines.' + operationId: faxLineList + parameters: + - + name: account_id + in: query + description: 'Account ID' + schema: + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + - + name: page + in: query + description: Page + schema: + type: integer + default: 1 + example: 1 + - + name: page_size + in: query + description: 'Page size' + schema: + type: integer + default: 20 + example: 20 + - + name: show_team_lines + in: query + description: 'Show team lines' + schema: + type: boolean + responses: + 200: + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineListResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineListResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineList.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineList.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineList.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineList.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineList.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineList.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineList.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineList.sh + x-meta: + seo: + title: 'List Fax Lines | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to list your fax lines, click here.' + /fax_line/remove_user: + put: + tags: + - 'Fax Line' + summary: 'Remove Fax Line Access' + description: 'Removes a user''s access to the specified Fax Line.' + operationId: faxLineRemoveUser + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineRemoveUserRequest' + examples: + default_example: + $ref: '#/components/examples/FaxLineRemoveUserRequestExample' + responses: + 200: + description: 'successful operation' + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + X-Ratelimit-Reset: + $ref: '#/components/headers/X-Ratelimit-Reset' + content: + application/json: + schema: + $ref: '#/components/schemas/FaxLineResponse' + examples: + default_example: + $ref: '#/components/examples/FaxLineResponseExample' + 4XX: + description: failed_operation + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + 400_example: + $ref: '#/components/examples/Error400ResponseExample' + 401_example: + $ref: '#/components/examples/Error401ResponseExample' + 402_example: + $ref: '#/components/examples/Error402ResponseExample' + 403_example: + $ref: '#/components/examples/Error403ResponseExample' + 404_example: + $ref: '#/components/examples/Error404ResponseExample' + 4XX_example: + $ref: '#/components/examples/Error4XXResponseExample' + security: + - + api_key: [] + x-codeSamples: + - + lang: PHP + label: PHP + source: + $ref: examples/FaxLineRemoveUser.php + - + lang: 'C#' + label: 'C#' + source: + $ref: examples/FaxLineRemoveUser.cs + - + lang: JavaScript + label: JavaScript + source: + $ref: examples/FaxLineRemoveUser.js + - + lang: TypeScript + label: TypeScript + source: + $ref: examples/FaxLineRemoveUser.ts + - + lang: Java + label: Java + source: + $ref: examples/FaxLineRemoveUser.java + - + lang: Ruby + label: Ruby + source: + $ref: examples/FaxLineRemoveUser.rb + - + lang: Python + label: Python + source: + $ref: examples/FaxLineRemoveUser.py + - + lang: cURL + label: cURL + source: + $ref: examples/FaxLineRemoveUser.sh + x-meta: + seo: + title: 'Fax Line Remove User | API Documentation | Dropbox Fax for Developers' + description: 'The Dropbox Fax API allows you to build custom integrations. To find out how to remove a user from an existing fax line, click here.' /oauth/token: post: tags: @@ -6409,6 +7206,145 @@ components: type: boolean default: false type: object + FaxLineAddUserRequest: + required: + - number + properties: + number: + description: 'The Fax Line number.' + type: string + account_id: + description: 'Account ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + email_address: + description: 'Email address' + type: string + format: email + type: object + FaxLineAreaCodeGetStateEnum: + type: string + enum: + - AK + - AL + - AR + - AZ + - CA + - CO + - CT + - DC + - DE + - FL + - GA + - HI + - IA + - ID + - IL + - IN + - KS + - KY + - LA + - MA + - MD + - ME + - MI + - MN + - MO + - MS + - MT + - NC + - ND + - NE + - NH + - NJ + - NM + - NV + - NY + - OH + - OK + - OR + - PA + - RI + - SC + - SD + - TN + - TX + - UT + - VA + - VT + - WA + - WI + - WV + - WY + FaxLineAreaCodeGetProvinceEnum: + type: string + enum: + - AB + - BC + - MB + - NB + - NL + - NT + - NS + - NU + - 'ON' + - PE + - QC + - SK + - YT + FaxLineAreaCodeGetCountryEnum: + type: string + enum: + - CA + - US + - UK + FaxLineCreateRequest: + required: + - area_code + - country + properties: + area_code: + description: 'Area code' + type: integer + country: + description: Country + type: string + enum: + - CA + - US + - UK + city: + description: City + type: string + account_id: + description: 'Account ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + type: object + FaxLineDeleteRequest: + required: + - number + properties: + number: + description: 'The Fax Line number.' + type: string + type: object + FaxLineRemoveUserRequest: + required: + - number + properties: + number: + description: 'The Fax Line number.' + type: string + account_id: + description: 'Account ID' + type: string + example: ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + email_address: + description: 'Email address' + type: string + format: email + type: object OAuthTokenGenerateRequest: required: - client_id @@ -9118,6 +10054,8 @@ components: default: false type: object AccountCreateResponse: + required: + - account properties: account: $ref: '#/components/schemas/AccountResponse' @@ -9131,6 +10069,8 @@ components: type: object x-internal-class: true AccountGetResponse: + required: + - account properties: account: $ref: '#/components/schemas/AccountResponse' @@ -9153,6 +10093,8 @@ components: type: object x-internal-class: true ApiAppGetResponse: + required: + - api_app properties: api_app: $ref: '#/components/schemas/ApiAppResponse' @@ -9164,6 +10106,9 @@ components: type: object x-internal-class: true ApiAppListResponse: + required: + - api_apps + - list_info properties: api_apps: description: 'Contains information about API Apps.' @@ -9180,6 +10125,10 @@ components: type: object x-internal-class: true BulkSendJobGetResponse: + required: + - bulk_send_job + - list_info + - signature_requests properties: bulk_send_job: $ref: '#/components/schemas/BulkSendJobResponse' @@ -9198,6 +10147,9 @@ components: type: object x-internal-class: true BulkSendJobListResponse: + required: + - bulk_send_jobs + - list_info properties: bulk_send_jobs: description: 'Contains a list of BulkSendJobs that the API caller has access to.' @@ -9214,6 +10166,8 @@ components: type: object x-internal-class: true BulkSendJobSendResponse: + required: + - bulk_send_job properties: bulk_send_job: $ref: '#/components/schemas/BulkSendJobResponse' @@ -9225,6 +10179,8 @@ components: type: object x-internal-class: true EmbeddedEditUrlResponse: + required: + - embedded properties: embedded: $ref: '#/components/schemas/EmbeddedEditUrlResponseEmbedded' @@ -9236,6 +10192,8 @@ components: type: object x-internal-class: true EmbeddedSignUrlResponse: + required: + - embedded properties: embedded: $ref: '#/components/schemas/EmbeddedSignUrlResponseEmbedded' @@ -9253,7 +10211,45 @@ components: error: $ref: '#/components/schemas/ErrorResponseError' type: object + FaxLineResponse: + required: + - fax_line + properties: + fax_line: + $ref: '#/components/schemas/FaxLineResponseFaxLine' + warnings: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true + FaxLineAreaCodeGetResponse: + required: + - area_codes + properties: + area_codes: + type: array + items: + type: integer + type: object + x-internal-class: true + FaxLineListResponse: + required: + - fax_lines + - list_info + properties: + list_info: + $ref: '#/components/schemas/ListInfoResponse' + fax_lines: + type: array + items: + $ref: '#/components/schemas/FaxLineResponseFaxLine' + warnings: + $ref: '#/components/schemas/WarningResponse' + type: object + x-internal-class: true FileResponse: + required: + - file_url + - expires_at properties: file_url: description: 'URL to the file.' @@ -9264,6 +10260,8 @@ components: type: object x-internal-class: true FileResponseDataUri: + required: + - data_uri properties: data_uri: description: 'File as base64 encoded string.' @@ -9271,6 +10269,8 @@ components: type: object x-internal-class: true ReportCreateResponse: + required: + - report properties: report: $ref: '#/components/schemas/ReportResponse' @@ -9282,6 +10282,8 @@ components: type: object x-internal-class: true SignatureRequestGetResponse: + required: + - signature_request properties: signature_request: $ref: '#/components/schemas/SignatureRequestResponse' @@ -9293,6 +10295,9 @@ components: type: object x-internal-class: true SignatureRequestListResponse: + required: + - signature_requests + - list_info properties: signature_requests: description: 'Contains information about signature requests.' @@ -9584,6 +10589,23 @@ components: description: 'Name of the error.' type: string type: object + FaxLineResponseFaxLine: + properties: + number: + description: Number + type: string + created_at: + description: 'Created at' + type: integer + updated_at: + description: 'Updated at' + type: integer + accounts: + type: array + items: + $ref: '#/components/schemas/AccountResponse' + type: object + x-internal-class: true ListInfoResponse: description: 'Contains pagination information about the data returned.' properties: @@ -9745,6 +10767,7 @@ components: signer: description: 'The Signer this attachment is assigned to.' type: string + x-int-or-string: true name: description: 'The name of this attachment.' type: string @@ -10374,6 +11397,7 @@ components: description: 'The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender).' type: string nullable: true + x-int-or-string: true x: description: 'The horizontal offset in pixels for this form field.' type: integer @@ -10489,6 +11513,7 @@ components: signer: description: 'The signer of the Form Field.' type: string + x-int-or-string: true x: description: 'The horizontal offset in pixels for this form field.' type: integer @@ -11100,6 +12125,8 @@ components: type: string type: object TeamGetResponse: + required: + - team properties: team: $ref: '#/components/schemas/TeamResponse' @@ -11111,6 +12138,8 @@ components: type: object x-internal-class: true TeamGetInfoResponse: + required: + - team properties: team: $ref: '#/components/schemas/TeamInfoResponse' @@ -11122,6 +12151,8 @@ components: type: object x-internal-class: true TeamInvitesResponse: + required: + - team_invites properties: team_invites: description: 'Contains a list of team invites and their roles.' @@ -11135,6 +12166,9 @@ components: type: object x-internal-class: true TeamMembersResponse: + required: + - team_members + - list_info properties: team_members: description: 'Contains a list of team members and their roles for a specific team.' @@ -11150,6 +12184,9 @@ components: type: object x-internal-class: true TeamSubTeamsResponse: + required: + - sub_teams + - list_info properties: sub_teams: description: 'Contains a list with sub teams.' @@ -11165,6 +12202,8 @@ components: type: object x-internal-class: true TemplateCreateResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateCreateResponseTemplate' @@ -11176,6 +12215,8 @@ components: type: object x-internal-class: true TemplateCreateEmbeddedDraftResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateCreateEmbeddedDraftResponseTemplate' @@ -11187,12 +12228,16 @@ components: type: object x-internal-class: true TemplateEditResponse: + required: + - template_id properties: template_id: description: 'The id of the Template.' type: string type: object TemplateGetResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateResponse' @@ -11204,6 +12249,9 @@ components: type: object x-internal-class: true TemplateListResponse: + required: + - templates + - list_info properties: templates: description: 'List of templates that the API caller has access to.' @@ -11220,12 +12268,16 @@ components: type: object x-internal-class: true TemplateUpdateFilesResponse: + required: + - template properties: template: $ref: '#/components/schemas/TemplateUpdateFilesResponseTemplate' type: object x-internal-class: true UnclaimedDraftCreateResponse: + required: + - unclaimed_draft properties: unclaimed_draft: $ref: '#/components/schemas/UnclaimedDraftResponse' @@ -11350,6 +12402,22 @@ components: summary: 'Default Example' value: $ref: examples/json/EmbeddedEditUrlRequestDefaultExample.json + FaxLineAddUserRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineAddUserRequestExample.json + FaxLineCreateRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineCreateRequestExample.json + FaxLineDeleteRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineDeleteRequestExample.json + FaxLineRemoveUserRequestExample: + summary: 'Default Example' + value: + $ref: examples/json/FaxLineRemoveUserRequestExample.json OAuthTokenGenerateRequestExample: summary: 'OAuth Token Generate Example' value: @@ -11594,6 +12662,18 @@ components: summary: 'Error 4XX failed_operation' value: $ref: examples/json/Error4XXResponseExample.json + FaxLineResponseExample: + summary: 'Sample Fax Line Response' + value: + $ref: examples/json/FaxLineResponseExample.json + FaxLineAreaCodeGetResponseExample: + summary: 'Sample Area Code Response' + value: + $ref: examples/json/FaxLineAreaCodeGetResponseExample.json + FaxLineListResponseExample: + summary: 'Sample Fax Line List Response' + value: + $ref: examples/json/FaxLineListResponseExample.json ReportCreateResponseExample: summary: Report value: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..99d5e96 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,71 @@ +[tool.poetry] +name = "dropbox_sign" +version = "1.6.0" +description = "Dropbox Sign API" +authors = ["Official Python SDK for the Dropbox Sign API "] +license = "MIT" +readme = "README.md" +repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "Dropbox Sign API"] +include = ["dropbox_sign/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" +types-python-dateutil = ">=2.8.19.14" +mypy = "1.4.1" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "dropbox_sign", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/requirements.txt b/requirements.txt index 96947f6..cc85509 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/run-build b/run-build index aa54dde..1e37027 100755 --- a/run-build +++ b/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/8b3cad0692b6c58f827c0a9b35f1ad733547504b/modules/openapi-generator/src/main/resources/python +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/python set -e @@ -9,7 +9,7 @@ WORKING_DIR="/app/python" docker run --rm \ -v "${DIR}/:/local" \ - openapitools/openapi-generator-cli:v5.3.0 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ diff --git a/setup.py b/setup.py index 63dcfd9..ffd7ddc 100644 --- a/setup.py +++ b/setup.py @@ -1,29 +1,35 @@ +# coding: utf-8 + """ Dropbox Sign API - Dropbox Sign v3 API # noqa: E501 + Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 from setuptools import setup, find_packages # noqa: H301 from pathlib import Path -NAME = "dropbox-sign" -VERSION = "1.5.0" # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools - +NAME = "dropbox-sign" +VERSION = "1.6.0" +PYTHON_REQUIRES = ">=3.7" REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", ] this_directory = Path(__file__).parent @@ -37,11 +43,11 @@ author_email="apisupport@hellosign.com", url="https://github.com/hellosign/dropbox-sign-python", keywords=["OpenAPI", "OpenAPI-Generator", "Dropbox Sign API"], - python_requires=">=3.7", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="MIT", long_description=long_description, - long_description_content_type='text/markdown' + long_description_content_type='text/markdown', + package_data={"dropbox_sign": ["py.typed"]}, ) diff --git a/templates/README.mustache b/templates/README.mustache index a8e53c5..5fe4264 100644 --- a/templates/README.mustache +++ b/templates/README.mustache @@ -1,9 +1,51 @@ # {{{projectName}}} - {{#appDescriptionWithNewLines}} {{{.}}} {{/appDescriptionWithNewLines}} +{{^useCustomTemplateCode}} +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} +- Build package: {{generatorClass}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Requirements. + +Python {{{generatorLanguageVersion}}} + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`) + +Then import the package: +```python +import {{{packageName}}} +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ## Migrating from legacy SDK This SDK is generated from our officially maintained [OpenAPI spec](https://github.com/hellosign/hellosign-openapi/blob/main/openapi.yaml). @@ -60,14 +102,20 @@ Alternatively: ```shell pip install git+https://github.com/hellosign/dropbox-sign-python.git ``` +{{/useCustomTemplateCode}} Then import the package: ```python import {{{packageName}}} ``` +{{^useCustomTemplateCode}} +### Tests +Execute `pytest` to run the tests. + +{{/useCustomTemplateCode}} ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: -{{> README_common }} +{{> common_README }} diff --git a/templates/README_common.mustache b/templates/README_common.mustache deleted file mode 100644 index 9de12f3..0000000 --- a/templates/README_common.mustache +++ /dev/null @@ -1,74 +0,0 @@ -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} -```python -REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Python_CODE -``` -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -|Class | Method | HTTP request | Description| -|------------ | ------------- | ------------- | -------------| -{{#apiInfo}}{{#apis}}{{#operations}}|{{#operation}}```{{classname}}``` | [```{{operationId}}```]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | ```{{httpMethod}} {{path}}``` | {{summary}}| -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation For Models - -{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) -{{/model}}{{/models}} - -## Documentation For Authorization - -{{^authMethods}} - All endpoints do not require authorization. -{{/authMethods}} -{{#authMethods}} -{{#last}} Authentication schemes defined for the API:{{/last}} -## {{{name}}} - -{{#isApiKey}} -- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}} -{{#isBasicBasic}} -- **Type**: HTTP basic authentication -{{/isBasicBasic}} -{{#isBasicBearer}} -- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} -{{/isBasicBearer}} -{{#isHttpSignature}} -- **Type**: HTTP signature authentication -{{/isHttpSignature}} -{{/isBasic}} -{{#isOAuth}} -- **Type**: OAuth -- **Flow**: {{{flow}}} -- **Authorization URL**: {{{authorizationUrl}}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - **{{{scope}}}**: {{{description}}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} - -## About this package - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{appVersion}} -- Package version: {{packageVersion}} -{{^hideGenerationTimestamp}} - - Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} -{{#infoUrl}} - For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} diff --git a/templates/README_onlypackage.mustache b/templates/README_onlypackage.mustache index ba08a3a..ae547b1 100644 --- a/templates/README_onlypackage.mustache +++ b/templates/README_onlypackage.mustache @@ -10,6 +10,7 @@ The `{{packageName}}` package is automatically generated by the [OpenAPI Generat {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} - Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -33,10 +34,11 @@ To be able to use it, you will need these dependencies in your own package that {{#tornado}} * tornado>=4.2,<5 {{/tornado}} +* pydantic ## Getting Started In your own code, to use this library to connect and interact with {{{projectName}}}, you can run the following: -{{> README_common }} +{{> common_README }} diff --git a/templates/__init__api.mustache b/templates/__init__api.mustache index 8a9e6b9..8870835 100644 --- a/templates/__init__api.mustache +++ b/templates/__init__api.mustache @@ -1,9 +1,5 @@ -{{#apiInfo}} -{{#apis}} -{{#-first}} -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from {{packageName}}.apis import {{classname}} -{{/-first}} -{{/apis}} -{{/apiInfo}} +# flake8: noqa + +# import apis into api package +{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} +{{/apis}}{{/apiInfo}} diff --git a/templates/__init__apis.mustache b/templates/__init__apis.mustache index 927bb6d..868a7a6 100644 --- a/templates/__init__apis.mustache +++ b/templates/__init__apis.mustache @@ -1,23 +1,12 @@ +{{#useCustomTemplateCode}} {{#apiInfo}} {{#apis}} {{#-first}} - # flake8: noqa -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from {{packagename}}.api.{{classFilename}} import {{classname}} -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - # Import APIs into API package: {{/-first}} from {{apiPackage}}.{{classFilename}} import {{classname}} {{/apis}} {{/apiInfo}} +{{/useCustomTemplateCode}} diff --git a/templates/__init__model.mustache b/templates/__init__model.mustache index cfe32b7..0e1b55e 100644 --- a/templates/__init__model.mustache +++ b/templates/__init__model.mustache @@ -1,5 +1,11 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from {{packageName}.models import ModelA, ModelB +# coding: utf-8 + +# flake8: noqa +{{>partial_header}} + +# import models into model package +{{#models}} +{{#model}} +from {{modelPackage}}.{{classFilename}} import {{classname}} +{{/model}} +{{/models}} diff --git a/templates/__init__models.mustache b/templates/__init__models.mustache deleted file mode 100644 index 76d91fc..0000000 --- a/templates/__init__models.mustache +++ /dev/null @@ -1,16 +0,0 @@ -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from {{modelPackage}}.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -{{#models}} -{{#model}} -from {{modelPackage}}.{{classFilename}} import {{classname}} -{{/model}} -{{/models}} diff --git a/templates/__init__package.mustache b/templates/__init__package.mustache index ce02cd6..e4d04b6 100644 --- a/templates/__init__package.mustache +++ b/templates/__init__package.mustache @@ -1,28 +1,44 @@ +# coding: utf-8 + # flake8: noqa {{>partial_header}} __version__ = "{{packageVersion}}" +# import apis into sdk package +{{^useCustomTemplateCode}} +{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} +{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +from dropbox_sign.apis import * + +{{/useCustomTemplateCode}} # import ApiClient +from {{packageName}}.api_response import ApiResponse from {{packageName}}.api_client import ApiClient - -# import Configuration from {{packageName}}.configuration import Configuration -{{#hasHttpSignatureMethods}} -from {{packageName}}.signing import HttpSigningConfiguration -{{/hasHttpSignatureMethods}} - -# import exceptions from {{packageName}}.exceptions import OpenApiException -from {{packageName}}.exceptions import ApiAttributeError from {{packageName}}.exceptions import ApiTypeError from {{packageName}}.exceptions import ApiValueError from {{packageName}}.exceptions import ApiKeyError +from {{packageName}}.exceptions import ApiAttributeError from {{packageName}}.exceptions import ApiException +{{#hasHttpSignatureMethods}} +from {{packageName}}.signing import HttpSigningConfiguration +{{/hasHttpSignatureMethods}} + +# import models into sdk package +{{#models}} +{{#model}} +from {{modelPackage}}.{{classFilename}} import {{classname}} +{{/model}} +{{/models}} +{{#useCustomTemplateCode}} +from dropbox_sign.event_callback_helper import EventCallbackHelper +{{/useCustomTemplateCode}} {{#recursionLimit}} __import__('sys').setrecursionlimit({{{.}}}) {{/recursionLimit}} - -from dropbox_sign.event_callback_helper import EventCallbackHelper diff --git a/templates/api.mustache b/templates/api.mustache index dffd9a0..3a3c7cd 100644 --- a/templates/api.mustache +++ b/templates/api.mustache @@ -1,376 +1,269 @@ -{{>partial_header}} +# coding: utf-8 -from __future__ import annotations -import re # noqa: F401 -import sys # noqa: F401 +{{>partial_header}} +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from {{packageName}}.api_client import ApiClient, ApiException, Endpoint as _Endpoint -from {{packageName}}.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) {{#imports}} -{{{import}}} +{{import}} {{/imports}} +from {{packageName}}.api_client import ApiClient, RequestSerialized +from {{packageName}}.api_response import ApiResponse +from {{packageName}}.rest import RESTResponseType +{{#useCustomTemplateCode}} +import io +{{/useCustomTemplateCode}} + -class {{classname}}(object): +{{#operations}} +class {{classname}}: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client -{{#operations}} {{#operation}} - self.{{operationId}}_endpoint = _Endpoint( - settings={ - 'response_type': {{#returnType}}({{{.}}},){{/returnType}}{{^returnType}}None{{/returnType}}, -{{#authMethods}} -{{#-first}} - 'auth': [ -{{/-first}} - '{{name}}'{{^-last}},{{/-last}} -{{#-last}} - ], -{{/-last}} -{{/authMethods}} -{{^authMethods}} - 'auth': [], -{{/authMethods}} - 'endpoint_path': '{{{path}}}', - 'operation_id': '{{operationId}}', - 'http_method': '{{httpMethod}}', -{{#servers}} -{{#-first}} - 'servers': [ -{{/-first}} - { - 'url': "{{{url}}}", - 'description': "{{{description}}}{{^description}}No description provided{{/description}}", - {{#variables}} - {{#-first}} - 'variables': { - {{/-first}} - '{{{name}}}': { - 'description': "{{{description}}}{{^description}}No description provided{{/description}}", - 'default_value': "{{{defaultValue}}}", - {{#enumValues}} - {{#-first}} - 'enum_values': [ - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ] - {{/-last}} - {{/enumValues}} - }{{^-last}},{{/-last}} - {{#-last}} - } - {{/-last}} - {{/variables}} - }, -{{#-last}} - ] -{{/-last}} -{{/servers}} -{{^servers}} - 'servers': None, -{{/servers}} - }, - params_map={ - 'all': [ -{{#allParams}} - '{{paramName}}', -{{/allParams}} - ], -{{#requiredParams}} -{{#-first}} - 'required': [ -{{/-first}} - '{{paramName}}', -{{#-last}} - ], -{{/-last}} -{{/requiredParams}} -{{^requiredParams}} - 'required': [], -{{/requiredParams}} - 'nullable': [ -{{#allParams}} -{{#isNullable}} - '{{paramName}}', -{{/isNullable}} -{{/allParams}} - ], - 'enum': [ -{{#allParams}} -{{#isEnum}} - '{{paramName}}', -{{/isEnum}} -{{/allParams}} - ], - 'validation': [ -{{#allParams}} -{{#hasValidation}} - '{{paramName}}', -{{/hasValidation}} -{{/allParams}} - ] - }, - root_map={ - 'validations': { -{{#allParams}} -{{#hasValidation}} - ('{{paramName}}',): { -{{#maxLength}} - 'max_length': {{.}},{{/maxLength}}{{#minLength}} - 'min_length': {{.}},{{/minLength}}{{#maxItems}} - 'max_items': {{.}},{{/maxItems}}{{#minItems}} - 'min_items': {{.}},{{/minItems}}{{#maximum}} - {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}{{^exclusiveMaximum}}'inclusive_maximum'{{/exclusiveMaximum}}: {{maximum}},{{/maximum}}{{#minimum}} - {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}{{^exclusiveMinimum}}'inclusive_minimum'{{/exclusiveMinimum}}: {{minimum}},{{/minimum}}{{#pattern}} - 'regex': { - 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}} - {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}} - },{{/pattern}} - }, -{{/hasValidation}} -{{/allParams}} - }, - 'allowed_values': { -{{#allParams}} -{{#isEnum}} - ('{{paramName}}',): { -{{#isNullable}} - 'None': None,{{/isNullable}}{{#allowableValues}}{{#enumVars}} - "{{name}}": {{{value}}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} - }, -{{/isEnum}} -{{/allParams}} - }, - 'openapi_types': { -{{#allParams}} - '{{paramName}}': - ({{{dataType}}},), -{{/allParams}} - }, - 'attribute_map': { -{{#allParams}} -{{^isBodyParam}} - '{{paramName}}': '{{baseName}}', -{{/isBodyParam}} -{{/allParams}} - }, - 'location_map': { -{{#allParams}} - '{{paramName}}': '{{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isCookieParam}}cookie{{/isCookieParam}}{{#isBodyParam}}body{{/isBodyParam}}', -{{/allParams}} - }, - 'collection_format_map': { -{{#allParams}} -{{#collectionFormat}} - '{{paramName}}': '{{collectionFormat}}', -{{/collectionFormat}} -{{/allParams}} - } - }, - headers_map={ -{{#hasProduces}} - 'accept': [ -{{#produces}} - '{{{mediaType}}}'{{^-last}},{{/-last}} -{{/produces}} - ], -{{/hasProduces}} -{{^hasProduces}} - 'accept': [], -{{/hasProduces}} -{{#hasConsumes}} - 'content_type': [ -{{#consumes}} - '{{{mediaType}}}'{{^-last}},{{/-last}} -{{/consumes}} - ] -{{/hasConsumes}} -{{^hasConsumes}} - 'content_type': [], -{{/hasConsumes}} - }, - api_client=api_client + + + @validate_call + {{#asyncio}}async {{/asyncio}}def {{operationId}}{{>partial_api_args}} -> {{{returnType}}}{{^returnType}}None{{/returnType}}: +{{>partial_api}} + response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) -{{/operation}} -{{/operations}} + {{#asyncio}}await {{/asyncio}}response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data -{{#operations}} -{{#operation}} - def {{operationId}}( + + @validate_call + {{#asyncio}}async {{/asyncio}}def {{operationId}}_with_http_info{{>partial_api_args}} -> ApiResponse[{{{returnType}}}{{^returnType}}None{{/returnType}}]: +{{>partial_api}} + response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + {{#asyncio}}await {{/asyncio}}response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + {{#asyncio}}async {{/asyncio}}def {{operationId}}_without_preload_content{{>partial_api_args}} -> RESTResponseType: +{{>partial_api}} + response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _{{operationId}}_serialize( self, -{{#requiredParams}} -{{^defaultValue}} + {{#allParams}} {{paramName}}, -{{/defaultValue}} -{{/requiredParams}} -{{#requiredParams}} -{{#defaultValue}} - {{paramName}}={{{defaultValue}}}, -{{/defaultValue}} -{{/requiredParams}} - **kwargs - ) -> {{#returnType}}{{.}}{{/returnType}}{{^returnType}}None{{/returnType}}: - """{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + {{/allParams}} + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: -{{#notes}} - {{{.}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + {{#servers.0}} + _hosts = [{{#servers}} + '{{{url}}}'{{^-last}},{{/-last}}{{/servers}} + ] + _host = _hosts[_host_index] + {{/servers.0}} + {{^servers.0}} + _host = None + {{/servers.0}} - >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True) - >>> result = thread.get() + _collection_formats: Dict[str, str] = { + {{#allParams}} + {{#isArray}} + '{{baseName}}': '{{collectionFormat}}', + {{/isArray}} + {{/allParams}} + } -{{#requiredParams}} -{{#-last}} - Args: -{{/-last}} -{{/requiredParams}} -{{#requiredParams}} -{{^defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{/requiredParams}} -{{#requiredParams}} -{{#defaultValue}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}] -{{/defaultValue}} -{{/requiredParams}} + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None - Keyword Args:{{#optionalParams}} - {{paramName}} ({{dataType}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}{{/optionalParams}} - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously +{{#useCustomTemplateCode}} + {{#bodyParam}} + has_files = False + body_param = {{#bodyParam}}{{paramName}}{{/bodyParam}} + excluded_json_fields = set([]) + for param_name, param_type in body_param.openapi_types().items(): + param_value = getattr(body_param, param_name) + if param_value is None: + continue - Returns: - {{returnType}}{{^returnType}}None{{/returnType}} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') -{{#requiredParams}} - kwargs['{{paramName}}'] = \ - {{paramName}} -{{/requiredParams}} - {{^returnType}} - return self.{{operationId}}_endpoint.call_with_http_info(**kwargs) - {{/returnType}} - {{#returnType}} - try: - return self.{{operationId}}_endpoint.call_with_http_info(**kwargs) - except ApiException as e: - {{#responses}} - {{#dataType}} - {{^isWildcard}} - {{^isRange}} - if e.status == {{code}}: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[{{{dataType}}}], - _check_type=True, - ) + if "io.IOBase" in param_type: + has_files = True + _content_type = "multipart/form-data" + excluded_json_fields.add(param_name) - raise e - {{/isRange}} - {{/isWildcard}} - {{/dataType}} - {{/responses}} - {{#responses}} - {{#dataType}} - {{#isRange}} - range_code = "{{code}}"[0] - range_code_left = int(f"{range_code}00") - range_code_right = int(f"{range_code}99") + if isinstance(param_value, list): + for index, item in enumerate(param_value): + _files[f'{param_name}[{index}]'] = item + else: + _files[param_name] = param_value - if range_code_left <= e.status <= range_code_right: - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[{{{dataType}}}], - _check_type=True, + if has_files is True: + _form_params = body_param.to_json_form_params(excluded_json_fields) + + {{/bodyParam}} +{{/useCustomTemplateCode}} + # process the path parameters +{{#pathParams}} + if {{paramName}} is not None: + _path_params['{{baseName}}'] = {{paramName}}{{#isEnumRef}}.value{{/isEnumRef}} +{{/pathParams}} + # process the query parameters +{{#queryParams}} + if {{paramName}} is not None: + {{#isDateTime}} + if isinstance({{paramName}}, datetime): + _query_params.append( + ( + '{{baseName}}', + {{paramName}}.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('{{baseName}}', {{paramName}})) + {{/isDateTime}} + {{#isDate}} + if isinstance({{paramName}}, date): + _query_params.append( + ( + '{{baseName}}', + {{paramName}}.strftime( + self.api_client.configuration.date_format + ) + ) ) + else: + _query_params.append(('{{baseName}}', {{paramName}})) + {{/isDate}} + {{^isDateTime}}{{^isDate}} + _query_params.append(('{{baseName}}', {{paramName}}{{#isEnumRef}}.value{{/isEnumRef}})) + {{/isDate}}{{/isDateTime}} +{{/queryParams}} + # process the header parameters +{{#headerParams}} + if {{paramName}} is not None: + _header_params['{{baseName}}'] = {{paramName}} +{{/headerParams}} + # process the form parameters +{{#formParams}} + if {{paramName}} is not None: + {{#isFile}} + _files['{{{baseName}}}'] = {{paramName}} + {{/isFile}} + {{^isFile}} + _form_params.append(('{{{baseName}}}', {{paramName}})) + {{/isFile}} +{{/formParams}} + # process the body parameter +{{#bodyParam}} +{{^useCustomTemplateCode}} + if {{paramName}} is not None: +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + if {{paramName}} is not None and has_files is False: +{{/useCustomTemplateCode}} + {{#isBinary}} + # convert to byte array if the input is a file name (str) + if isinstance({{paramName}}, str): + with open({{paramName}}, "rb") as _fp: + _body_params = _fp.read() + else: + _body_params = {{paramName}} + {{/isBinary}} + {{^isBinary}} + _body_params = {{paramName}} + {{/isBinary}} +{{/bodyParam}} + + {{#constantParams}} + {{#isQueryParam}} + # Set client side default value of Query Param "{{baseName}}". + _query_params.append(('{{baseName}}', {{#_enum}}'{{{.}}}'{{/_enum}})) + {{/isQueryParam}} + {{#isHeaderParam}} + # Set client side default value of Header Param "{{baseName}}". + _header_params['{{baseName}}'] = {{#_enum}}'{{{.}}}'{{/_enum}} + {{/isHeaderParam}} + {{/constantParams}} + + {{#hasProduces}} + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [{{#produces}} + '{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}} + ] + ) + {{/hasProduces}} - raise e - {{/isRange}} - {{/dataType}} - {{/responses}} - {{#responses}} - {{#dataType}} - {{#isWildcard}} - e.body = self.api_client.deserialize( - response=type('obj_dict', (object,), {'data': e.body}), - response_type=[{{{dataType}}}], - _check_type=True, + {{#hasConsumes}} + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [{{#consumes}} + '{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}} + ] + ) ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + {{/hasConsumes}} + + # authentication setting + _auth_settings: List[str] = [{{#authMethods}} + '{{name}}'{{^-last}}, {{/-last}}{{/authMethods}} + ] + + return self.api_client.param_serialize( + method='{{httpMethod}}', + resource_path='{{{path}}}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - raise e - {{/isWildcard}} - {{/dataType}} - {{/responses}} - {{/returnType}} {{/operation}} {{/operations}} diff --git a/templates/api_client.mustache b/templates/api_client.mustache index 4891673..69e75c9 100644 --- a/templates/api_client.mustache +++ b/templates/api_client.mustache @@ -1,40 +1,44 @@ +# coding: utf-8 + {{>partial_header}} +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal import json -import atexit import mimetypes -from multiprocessing.pool import ThreadPool -import io import os import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField +import tempfile +{{#useCustomTemplateCode}} +import io +{{/useCustomTemplateCode}} +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr {{#tornado}} import tornado.gen {{/tornado}} -from {{packageName}} import rest from {{packageName}}.configuration import Configuration -from {{packageName}}.exceptions import ApiTypeError, ApiValueError, ApiException -from {{packageName}}.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types +from {{packageName}}.api_response import ApiResponse, T as ApiResponseT +import {{modelPackage}} +from {{packageName}} import rest +from {{packageName}}.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException ) +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] -class ApiClient(object): +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -42,28 +46,39 @@ class ApiClient(object): the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided if configuration is None: - configuration = Configuration.get_default_copy() + configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -72,30 +87,25 @@ class ApiClient(object): self.cookie = cookie # Set default User-Agent. self.user_agent = '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' + self.client_side_validation = configuration.client_side_validation - def __enter__(self): +{{#asyncio}} + async def __aenter__(self): return self - def __exit__(self, exc_type, exc_value, traceback): - self.close() + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) + async def close(self): + await self.rest_client.close() +{{/asyncio}} +{{^asyncio}} + def __enter__(self): + return self - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + def __exit__(self, exc_type, exc_value, traceback): + pass +{{/asyncio}} @property def user_agent(self): @@ -109,29 +119,69 @@ class ApiClient(object): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - {{#tornado}} - @tornado.gen.coroutine - {{/tornado}} - {{#asyncio}}async {{/asyncio}}def __call_api( + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None - ): + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -142,14 +192,17 @@ class ApiClient(object): header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -157,350 +210,272 @@ class ApiClient(object): quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict) ) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) - # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead url = _host + resource_path + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + {{#tornado}} + @tornado.gen.coroutine + {{/tornado}} + {{#asyncio}}async {{/asyncio}}def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + except ApiException as e: - e.body = e.body.decode('utf-8') raise e - self.last_response = response_data + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ - return_data = response_data + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg - if not _preload_content: - {{^tornado}} - return (return_data) - {{/tornado}} - {{#tornado}} - raise tornado.gen.Return(return_data) - {{/tornado}} - return return_data + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None content_type = response_data.getheader('content-type') if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - -{{^tornado}} - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) -{{/tornado}} -{{#tornado}} - if _return_http_data_only: - raise tornado.gen.Return(return_data) - else: - raise tornado.gen.Return((return_data, response_data.status, - response_data.getheaders())) -{{/tornado}} + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes + :param obj: The data to serialize. :return: The serialized form of data. """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() - } - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): return obj - elif isinstance(obj, (datetime, date)): + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item) for item in obj] - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) # fetch data from response object - try: - received_data = json.loads(response.data) - except TypeError: - received_data = response.data - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. + return self.__deserialize(data, response_type) - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr({{modelPackage}}, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) + return self.__deserialize_model(data, klass) def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -509,10 +484,10 @@ class ApiClient(object): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -532,405 +507,312 @@ class ApiClient(object): new_params.append((k, v)) return new_params - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): - """Builds form parameters. + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) """ - if files is None: - return [] + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) + else: + new_params.append((k, quote(str(v)))) + return "&".join(["=".join(map(str, item)) for item in new_params]) + +{{^useCustomTemplateCode}} + def files_parameters(self, files: Dict[str, Union[str, bytes]]): +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + def files_parameters(self, files: Dict[str, Union[str, bytes, io.IOBase]]): +{{/useCustomTemplateCode}} + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v +{{#useCustomTemplateCode}} + elif isinstance(v, io.IOBase): + filename = os.path.basename(v.name) + filedata = v.read() +{{/useCustomTemplateCode}} + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) + return accepts[0] - def select_header_content_type(self, content_types, method=None, body=None): + def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: - return 'application/json' + return None - content_types = [x.lower() for x in content_types] + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' + return content_types[0] - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body): + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] -{{#hasHttpSignatureMethods}} - else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, queries) - headers.update(auth_headers) -{{/hasHttpSignatureMethods}} - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting ) + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + {{#hasHttpSignatureMethods}} + else: + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, queries) + headers.update(auth_headers) + {{/hasHttpSignatureMethods}} + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) + def __deserialize_file(self, response): + """Deserializes body to file - if kwargs['_check_input_type'] is False: - return + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - """We want to support a single typed object parameter for all endpoints, - including of multipart/form-data content-types. - """ - body = param_value.to_dict() - remove_files = [] - - for oas_name in param_value.openapi_types: - if hasattr(param_value, oas_name): - obj = param_value[oas_name] - if isinstance(obj, file_type): - params['file'][oas_name] = [obj] - remove_files.append(oas_name) - elif isinstance(obj, list): - i = 0 - for obj_value in obj: - if isinstance(obj_value, file_type): - key = oas_name + '[' + str(i) + ']' - params['file'][key] = [obj_value] - remove_files.append(oas_name) - i += 1 - - # remove duplicates - remove_files = list(set(remove_files)) - - for remove in remove_files: - body.pop(remove) - - if len(remove_files): - for param in body: - param_value_full = (param, body[param]) - - # do not change non-JSON values - if (not isinstance(body[param], (str, bool, int, float))): - param_value_full = (param, json.dumps(body[param])) - - params['form'].append(param_value_full) - else: - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][base_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format + with open(path, "wb") as f: + f.write(response.data) - return params + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} - api_instance = {{classname}}() - api_instance.{{operationId}} # this is an instance of the class Endpoint - api_instance.{{operationId}}() # this invokes api_instance.{{operationId}}.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.{{operationId}}.callable or self.callable in this class -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. """ - return self.callable(self, *args, **kwargs) + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data - def call_with_http_info(self, **kwargs): + def __deserialize_object(self, value): + """Return an original value. + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) + def __deserialize_datetime(self, string): + """Deserializes string to datetime. - self.__validate_inputs(kwargs) + The string should be in iso8601 datetime format. - params = self.__gather_params(kwargs) + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) - # Remove None values from query parameters - query_to_keep = [] - for key, value in params['query']: - if value is not None: - query_to_keep = query_to_keep + [(key, value)] + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. - params['query'] = query_to_keep + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if len(params['form']) > 0 or ('file' in params.keys() and len(params['file']) > 0): - params['header']['Content-Type'] = 'multipart/form-data' - elif params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - params['header']['Content-Type'] = header_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - collection_formats=params['collection_format']) + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/templates/api_doc.mustache b/templates/api_doc.mustache index 7e690ca..ac6d3f8 100644 --- a/templates/api_doc.mustache +++ b/templates/api_doc.mustache @@ -1,17 +1,35 @@ +{{^useCustomTemplateCode}} +# {{packageName}}.{{classname}}{{#description}} +{{.}}{{/description}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} # ```{{packageName}}.{{classname}}```{{#description}} {{.}}{{/description}} +{{/useCustomTemplateCode}} All URIs are relative to *{{basePath}}* -|Method | HTTP request | Description| -|------------- | ------------- | -------------| +Method | HTTP request | Description +------------- | ------------- | ------------- +{{^useCustomTemplateCode}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#operations}}{{#operation}}|[```{{operationId}}```]({{classname}}.md#{{operationId}}) | ```{{httpMethod}} {{path}}``` | {{summary}}| {{/operation}}{{/operations}} +{{/useCustomTemplateCode}} {{#operations}} {{#operation}} +{{^useCustomTemplateCode}} +# **{{{operationId}}}** +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} # ```{{{operationId}}}``` > ```{{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}})``` +{{/useCustomTemplateCode}} {{{summary}}}{{#notes}} @@ -37,11 +55,17 @@ All URIs are relative to *{{basePath}}* {{/isOAuth }} {{/authMethods}} {{/hasAuthMethods}} - {{> api_doc_example }} ### Parameters - +{{^useCustomTemplateCode}} +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} +{{/allParams}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{^allParams}} This endpoint does not need any parameter. {{/allParams}} @@ -52,6 +76,7 @@ This endpoint does not need any parameter. {{/-first}} | `{{paramName}}` | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | {{/allParams}} +{{/useCustomTemplateCode}} ### Return type @@ -67,7 +92,6 @@ This endpoint does not need any parameter. - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} {{#responses.0}} - ### HTTP response details | Status code | Description | Response headers | diff --git a/templates/api_doc_example.mustache b/templates/api_doc_example.mustache index 5878403..2392430 100644 --- a/templates/api_doc_example.mustache +++ b/templates/api_doc_example.mustache @@ -1,3 +1,45 @@ + +{{^useCustomTemplateCode}} +```python +import {{{packageName}}} +{{#vendorExtensions.x-py-example-import}} +{{{.}}} +{{/vendorExtensions.x-py-example-import}} +from {{{packageName}}}.rest import ApiException +from pprint import pprint + +{{> python_doc_auth_partial}} +# Enter a context with an instance of the API client +{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = {{{packageName}}}.{{{classname}}}(api_client) + {{#allParams}} + {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/allParams}} + + try: + {{#summary}} + # {{{.}}} + {{/summary}} + {{#returnType}}api_response = {{/returnType}}{{#asyncio}}await {{/asyncio}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + {{#returnType}} + print("The response of {{classname}}->{{operationId}}:\n") + pprint(api_response) + {{/returnType}} + except Exception as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +``` + +{{#vendorExtensions.x-py-postponed-example-imports.size}} +{{#vendorExtensions.x-py-postponed-example-imports}} +{{{.}}} +{{/vendorExtensions.x-py-postponed-example-imports}} +{{classname}}.update_forward_refs() +{{/vendorExtensions.x-py-postponed-example-imports.size}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ```python REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Python_CODE ``` +{{/useCustomTemplateCode}} +``` \ No newline at end of file diff --git a/templates/api_response.mustache b/templates/api_response.mustache new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/templates/api_response.mustache @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/templates/api_test.mustache b/templates/api_test.mustache index 8f3d764..5354d3c 100644 --- a/templates/api_test.mustache +++ b/templates/api_test.mustache @@ -1,26 +1,27 @@ +# coding: utf-8 + {{>partial_header}} import unittest -import {{packageName}} -from {{apiPackage}}.{{classFilename}} import {{classname}} # noqa: E501 +from {{apiPackage}}.{{classFilename}} import {{classname}} class {{#operations}}Test{{classname}}(unittest.TestCase): """{{classname}} unit test stubs""" - def setUp(self): - self.api = {{classname}}() # noqa: E501 + def setUp(self) -> None: + self.api = {{classname}}() - def tearDown(self): + def tearDown(self) -> None: pass {{#operation}} - def test_{{operationId}}(self): + def test_{{operationId}}(self) -> None: """Test case for {{{operationId}}} {{#summary}} - {{{.}}} # noqa: E501 + {{{.}}} {{/summary}} """ pass diff --git a/templates/asyncio/rest.mustache b/templates/asyncio/rest.mustache index d69e7fd..c3f8643 100644 --- a/templates/asyncio/rest.mustache +++ b/templates/asyncio/rest.mustache @@ -1,46 +1,54 @@ +# coding: utf-8 + {{>partial_header}} import io import json -import logging import re import ssl +from typing import Optional, Union import aiohttp -# python 2 and python 3 compatibility library -from six.moves.urllib.parse import urlencode +import aiohttp_retry from {{packageName}}.exceptions import ApiException, ApiValueError -logger = logging.getLogger(__name__) +RESTResponseType = aiohttp.ClientResponse +ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'}) class RESTResponse(io.IOBase): - def __init__(self, resp, data): - self.aiohttp_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = data + self.data = None + + async def read(self): + if self.data is None: + self.data = await self.response.read() + return self.data def getheaders(self): """Returns a CIMultiDictProxy of the response headers.""" - return self.aiohttp_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.aiohttp_response.headers.get(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # maxsize is number of requests to host that are allowed in parallel - if maxsize is None: - maxsize = configuration.connection_pool_maxsize + maxsize = configuration.connection_pool_maxsize - ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert + ) if configuration.cert_file: ssl_context.load_cert_chain( configuration.cert_file, keyfile=configuration.key_file @@ -64,32 +72,59 @@ class RESTClientObject(object): trust_env=True ) + retries = configuration.retries + self.retry_client: Optional[aiohttp_retry.RetryClient] + if retries is not None: + self.retry_client = aiohttp_retry.RetryClient( + client_session=self.pool_manager, + retry_options=aiohttp_retry.ExponentialRetry( + attempts=retries, + factor=2.0, + start_timeout=0.1, + max_timeout=120.0 + ) + ) + else: + self.retry_client = None + async def close(self): await self.pool_manager.close() - - async def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + if self.retry_client is not None: + await self.retry_client.close() + + async def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Execute request :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: this is a non-applicable field for - the AiohttpClient. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -98,6 +133,7 @@ class RESTClientObject(object): post_params = post_params or {} headers = headers or {} + # url already contains the URL query string timeout = _request_timeout or 5 * 60 if 'Content-Type' not in headers: @@ -115,16 +151,13 @@ class RESTClientObject(object): if self.proxy_headers: args["proxy_headers"] = self.proxy_headers - if query_params: - args["url"] += '?' + urlencode(query_params) - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: if re.search('json', headers['Content-Type'], re.IGNORECASE): if body is not None: body = json.dumps(body) args["data"] = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': args["data"] = aiohttp.FormData(post_params) elif headers['Content-Type'] == 'multipart/form-data': # must del headers['Content-Type'], or the correct @@ -134,18 +167,20 @@ class RESTClientObject(object): for param in post_params: k, v = param if isinstance(v, tuple) and len(v) == 3: - data.add_field(k, - value=v[1], - filename=v[0], - content_type=v[2]) + data.add_field( + k, + value=v[1], + filename=v[0], + content_type=v[2] + ) else: data.add_field(k, v) args["data"] = data - # Pass a `bytes` parameter directly in the body to support + # Pass a `bytes` or `str` parameter directly in the body to support # other content types than Json when `body` argument is provided # in serialized form - elif isinstance(body, bytes): + elif isinstance(body, str) or isinstance(body, bytes): args["data"] = body else: # Cannot generate the request from given parameters @@ -154,84 +189,17 @@ class RESTClientObject(object): declared content type.""" raise ApiException(status=0, reason=msg) - r = await self.pool_manager.request(**args) - if _preload_content: - - data = await r.read() - r = RESTResponse(r, data) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - return r - - async def GET(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - return (await self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def HEAD(self, url, headers=None, query_params=None, - _preload_content=True, _request_timeout=None): - return (await self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params)) - - async def OPTIONS(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return (await self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def POST(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return (await self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) - - async def PATCH(self, url, headers=None, query_params=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - return (await self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body)) + pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient] + if self.retry_client is not None and method in ALLOW_RETRY_METHODS: + pool_manager = self.retry_client + else: + pool_manager = self.pool_manager + + r = await pool_manager.request(**args) + + return RESTResponse(r) + + + + + diff --git a/templates/common_README.mustache b/templates/common_README.mustache new file mode 100644 index 0000000..163470c --- /dev/null +++ b/templates/common_README.mustache @@ -0,0 +1,115 @@ +{{^useCustomTemplateCode}} +```python +{{#apiInfo}}{{#apis}}{{#-last}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/-last}}{{/apis}}{{/apiInfo}} +import {{{packageName}}} +from {{{packageName}}}.rest import ApiException +from pprint import pprint +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +{{> python_doc_auth_partial}} + +# Enter a context with an instance of the API client +{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = {{{packageName}}}.{{{classname}}}(api_client) + {{#allParams}} + {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/allParams}} + + try: + {{#summary}} + # {{{.}}} + {{/summary}} + {{#returnType}}api_response = {{/returnType}}{{#asyncio}}await {{/asyncio}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + {{#returnType}} + print("The response of {{classname}}->{{operationId}}:\n") + pprint(api_response) + {{/returnType}} + except ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +```python +REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_Python_CODE +``` +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{^useCustomTemplateCode}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +{{#apiInfo}}{{#apis}}{{#operations}}|{{#operation}}```{{classname}}``` | [```{{operationId}}```]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | ```{{httpMethod}} {{path}}``` | {{summary}}| +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/useCustomTemplateCode}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} + + +## Documentation For Authorization + +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} + +### {{{name}}} + +{{#isApiKey}} +- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}} +{{#isBasicBasic}} +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} +- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{#isHttpSignature}} +- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{/isBasic}} +{{#isOAuth}} +- **Type**: OAuth +- **Flow**: {{{flow}}} +- **Authorization URL**: {{{authorizationUrl}}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - **{{{scope}}}**: {{{description}}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} +{{/-last}}{{/apis}}{{/apiInfo}} + +{{#useCustomTemplateCode}} +## About this package + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{^hideGenerationTimestamp}} + - Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} +{{/useCustomTemplateCode}} diff --git a/templates/configuration.mustache b/templates/configuration.mustache index 150aff3..0096589 100644 --- a/templates/configuration.mustache +++ b/templates/configuration.mustache @@ -1,16 +1,18 @@ +# coding: utf-8 + {{>partial_header}} import copy import logging +from logging import FileHandler {{^asyncio}} import multiprocessing {{/asyncio}} import sys +from typing import Optional import urllib3 -from http import client as http_client -from {{packageName}}.exceptions import ApiValueError - +import http.client as httplib JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -18,46 +20,23 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. +class Configuration: + """This class contains various settings of the API client. - :param host: Base url + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. {{#hasHttpSignatureMethods}} :param signing_info: Configuration parameters for the HTTP signature security scheme. Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration @@ -70,9 +49,11 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format + in PEM format. + :param retries: Number of retries for API requests. {{#hasAuthMethods}} :Example: @@ -110,8 +91,13 @@ conf = {{{packageName}}}.Configuration( Configure API client with HTTP basic authentication: conf = {{{packageName}}}.Configuration( +{{^useCustomTemplateCode}} username='the-user', password='the-password', +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + username='YOUR_API_KEY', +{{/useCustomTemplateCode}} ) {{/hasHttpBasicMethods}} @@ -163,17 +149,19 @@ conf = {{{packageName}}}.Configuration( def __init__(self, host=None, api_key=None, api_key_prefix=None, - access_token=None, username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", + access_token=None, {{#hasHttpSignatureMethods}} signing_info=None, {{/hasHttpSignatureMethods}} server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, ssl_ca_cert=None, - ): + retries=None, + *, + debug: Optional[bool] = None + ) -> None: """Constructor """ self._base_path = "{{{basePath}}}" if host is None else host @@ -187,13 +175,20 @@ conf = {{{packageName}}}.Configuration( self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ # Authentication Settings - self.access_token = access_token self.api_key = {} +{{^useCustomTemplateCode}} if api_key: +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + if api_key and not username: +{{/useCustomTemplateCode}} self.api_key = api_key """dict to store API key(s) """ @@ -211,8 +206,9 @@ conf = {{{packageName}}}.Configuration( self.password = password """Password for HTTP basic authentication """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations + self.access_token = access_token + """Access token + """ {{#hasHttpSignatureMethods}} if signing_info is not None: signing_info.host = host @@ -231,13 +227,16 @@ conf = {{{packageName}}}.Configuration( self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -258,6 +257,10 @@ conf = {{{packageName}}}.Configuration( self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ {{#asyncio}} self.connection_pool_maxsize = 100 @@ -275,26 +278,32 @@ conf = {{{packageName}}}.Configuration( """ {{/asyncio}} - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ self.proxy_headers = None """Proxy headers """ self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation self.client_side_validation = True - # Options to pass down to the underlying urllib3 socket self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "{{{datetimeFormat}}}" + """datetime format + """ + + self.date_format = "{{{dateFormat}}}" + """date format + """ def __deepcopy__(self, memo): cls = self.__class__ @@ -312,13 +321,6 @@ conf = {{{packageName}}}.Configuration( def __setattr__(self, name, value): object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s {{#hasHttpSignatureMethods}} if name == "signing_info" and value is not None: # Ensure the host parameter from signing info is the same as @@ -335,21 +337,31 @@ conf = {{{packageName}}}.Configuration( :param default: object of Configuration """ - cls._default = copy.deepcopy(default) + cls._default = default @classmethod def get_default_copy(cls): - """Return new instance of configuration. + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default - configuration passed by the set_default method. + configuration. :return: The configuration object. """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() + if cls._default is None: + cls._default = Configuration() + return cls._default @property def logger_file(self): @@ -403,15 +415,15 @@ conf = {{{packageName}}}.Configuration( # if debug status is True, turn on debug logging for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 @property def logger_format(self): @@ -489,7 +501,12 @@ conf = {{{packageName}}}.Configuration( {{/isApiKey}} {{#isBasic}} {{#isBasicBasic}} - if self.username is not None or self.password is not None: +{{^useCustomTemplateCode}} + if self.username is not None and self.password is not None: +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + if self.username is not None: +{{/useCustomTemplateCode}} auth['{{name}}'] = { 'type': 'basic', 'in': 'header', diff --git a/templates/exceptions.mustache b/templates/exceptions.mustache index 046dcd9..65781d4 100644 --- a/templates/exceptions.mustache +++ b/templates/exceptions.mustache @@ -1,5 +1,11 @@ -{{>partial_header}} +# coding: utf-8 +{{>partial_header}} +from typing import Any, Optional +from typing_extensions import Self +{{#useCustomTemplateCode}} +from dropbox_sign.models.error_response import ErrorResponse +{{/useCustomTemplateCode}} class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -7,7 +13,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -35,7 +41,7 @@ class ApiTypeError(OpenApiException, TypeError): class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -53,7 +59,7 @@ class ApiValueError(OpenApiException, ValueError): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -72,7 +78,7 @@ class ApiAttributeError(OpenApiException, AttributeError): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -90,17 +96,61 @@ class ApiKeyError(OpenApiException, KeyError): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body +{{^useCustomTemplateCode}} + self.data = data +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + self.data: ErrorResponse = data +{{/useCustomTemplateCode}} + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" @@ -110,34 +160,30 @@ class ApiException(OpenApiException): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message -class NotFoundException(ApiException): +class BadRequestException(ApiException): + pass - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) +class NotFoundException(ApiException): + pass -class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) +class UnauthorizedException(ApiException): + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) + pass def render_path(path_to_item): diff --git a/templates/github-workflow.mustache b/templates/github-workflow.mustache new file mode 100644 index 0000000..868124c --- /dev/null +++ b/templates/github-workflow.mustache @@ -0,0 +1,39 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: {{packageName}} Python package +{{=<% %>=}} + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/templates/gitignore.mustache b/templates/gitignore.mustache index 491b708..609c201 100644 --- a/templates/gitignore.mustache +++ b/templates/gitignore.mustache @@ -65,4 +65,7 @@ target/ #Ipython Notebook .ipynb_checkpoints +{{#useCustomTemplateCode}} +.openapi-generator /vendor +{{/useCustomTemplateCode}} \ No newline at end of file diff --git a/templates/gitlab-ci.mustache b/templates/gitlab-ci.mustache index cf785a8..8a6130a 100644 --- a/templates/gitlab-ci.mustache +++ b/templates/gitlab-ci.mustache @@ -1,29 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# # ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml stages: - test -.tests: +.pytest: stage: test script: - pip install -r requirements.txt - pip install -r test-requirements.txt - {{#useNose}} - - nosetests - {{/useNose}} - {{^useNose}} - pytest --cov={{{packageName}}} - {{/useNose}} -test-3.6: - extends: .tests - image: python:3.6-alpine -test-3.7: - extends: .tests +pytest-3.7: + extends: .pytest image: python:3.7-alpine -test-3.8: - extends: .tests +pytest-3.8: + extends: .pytest image: python:3.8-alpine -test-3.9: - extends: .tests +pytest-3.9: + extends: .pytest image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine diff --git a/templates/model.mustache b/templates/model.mustache index e6705eb..84792dd 100644 --- a/templates/model.mustache +++ b/templates/model.mustache @@ -1,87 +1,14 @@ -{{> partial_header }} +# coding: utf-8 -from __future__ import annotations -from typing import TYPE_CHECKING, Optional, List, Dict, Union -import json # noqa: F401 -import re # noqa: F401 -import sys # noqa: F401 - -from {{packageName}} import ApiClient -from {{packageName}}.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from {{packageName}}.exceptions import ApiAttributeError -{{#imports}} -{{#-first}} -if TYPE_CHECKING: -{{/-first}} - {{{import}}} -{{/imports}} +{{>partial_header}} {{#models}} {{#model}} -{{#discriminator}} -{{#-first}} -if TYPE_CHECKING: -{{/-first}} -{{#discriminator.mappedModels}} - from {{packageName}}.models import {{modelName}} -{{#-last}} - -{{/-last}} -{{/discriminator.mappedModels}} - -def lazy_import(): -{{#discriminator.mappedModels}} - from {{packageName}}.models import {{modelName}} -{{/discriminator.mappedModels}} -{{#discriminator.mappedModels}} - globals()['{{modelName}}'] = {{modelName}} -{{/discriminator.mappedModels}} -{{/discriminator}} -{{#imports}} -{{#-first}} - -def lazy_import(): -{{/-first}} - {{{.}}} -{{/imports}} - - -{{^interfaces}} -{{#isArray}} -{{> model_templates/model_simple }} -{{/isArray}} {{#isEnum}} -{{> model_templates/model_simple }} +{{>model_enum}} {{/isEnum}} -{{#isAlias}} -{{> model_templates/model_simple }} -{{/isAlias}} -{{^isArray}} {{^isEnum}} -{{^isAlias}} -{{> model_templates/model_normal }} -{{/isAlias}} +{{#oneOf}}{{#-first}}{{>model_oneof}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>model_anyof}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>model_generic}}{{/anyOf}}{{/oneOf}} {{/isEnum}} -{{/isArray}} -{{/interfaces}} -{{#interfaces}} -{{#-last}} -{{> model_templates/model_composed }} -{{/-last}} -{{/interfaces}} {{/model}} {{/models}} \ No newline at end of file diff --git a/templates/model_anyof.mustache b/templates/model_anyof.mustache new file mode 100644 index 0000000..e035e48 --- /dev/null +++ b/templates/model_anyof.mustache @@ -0,0 +1,182 @@ +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +{{#vendorExtensions.x-py-other-imports}} +{{{.}}} +{{/vendorExtensions.x-py-other-imports}} +{{#vendorExtensions.x-py-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-model-imports}} +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +{{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ANY_OF_SCHEMAS = [{{#anyOf}}"{{.}}"{{^-last}}, {{/-last}}{{/anyOf}}] + +class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): + """ + {{{description}}}{{^description}}{{{classname}}}{{/description}} + """ + +{{#composedSchemas.anyOf}} + # data type: {{{dataType}}} + {{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}} +{{/composedSchemas.anyOf}} + if TYPE_CHECKING: + actual_instance: Optional[Union[{{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { {{#anyOf}}"{{.}}"{{^-last}}, {{/-last}}{{/anyOf}} } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } +{{#discriminator}} + + discriminator_value_class_map: Dict[str, str] = { +{{#children}} + '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},{{/-last}} +{{/children}} + } +{{/discriminator}} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + {{#isNullable}} + if v is None: + return v + + {{/isNullable}} + instance = {{{classname}}}.model_construct() + error_messages = [] + {{#composedSchemas.anyOf}} + # validate data type: {{{dataType}}} + {{#isContainer}} + try: + instance.{{vendorExtensions.x-py-name}} = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isContainer}} + {{^isContainer}} + {{#isPrimitiveType}} + try: + instance.{{vendorExtensions.x-py-name}} = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if not isinstance(v, {{{dataType}}}): + error_messages.append(f"Error! Input type `{type(v)}` is not `{{{dataType}}}`") + else: + return v + + {{/isPrimitiveType}} + {{/isContainer}} + {{/composedSchemas.anyOf}} + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in {{{classname}}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + {{#isNullable}} + if json_str is None: + return instance + + {{/isNullable}} + error_messages = [] + {{#composedSchemas.anyOf}} + {{#isContainer}} + # deserialize data into {{{dataType}}} + try: + # validation + instance.{{vendorExtensions.x-py-name}} = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.{{vendorExtensions.x-py-name}} + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isContainer}} + {{^isContainer}} + {{#isPrimitiveType}} + # deserialize data into {{{dataType}}} + try: + # validation + instance.{{vendorExtensions.x-py-name}} = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.{{vendorExtensions.x-py-name}} + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{^isPrimitiveType}} + # {{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}} + try: + instance.actual_instance = {{{dataType}}}.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{/isContainer}} + {{/composedSchemas.anyOf}} + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into {{{classname}}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], {{#anyOf}}{{.}}{{^-last}}, {{/-last}}{{/anyOf}}]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + +{{#vendorExtensions.x-py-postponed-model-imports.size}} +{{#vendorExtensions.x-py-postponed-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-postponed-model-imports}} +# TODO: Rewrite to not use raise_errors +{{classname}}.model_rebuild(raise_errors=False) +{{/vendorExtensions.x-py-postponed-model-imports.size}} diff --git a/templates/model_doc.mustache b/templates/model_doc.mustache index b81c150..a63aea6 100644 --- a/templates/model_doc.mustache +++ b/templates/model_doc.mustache @@ -1,15 +1,56 @@ {{#models}}{{#model}}# {{classname}} +{{^useCustomTemplateCode}} +{{#description}}{{&description}} +{{/description}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{unescapedDescription}} +{{/useCustomTemplateCode}} +{{^useCustomTemplateCode}} +{{^isEnum}} ## Properties -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -{{#vars}}| `{{name}}`{{#required}}*_required_{{/required}} | {{#isPrimitiveType}}```{{{dataType}}}```{{/isPrimitiveType}}{{^isPrimitiveType}}[```{{{dataType}}}```]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{#isReadOnly}} [readonly]{{/isReadOnly}}{{#defaultValue}} [default to {{{.}}}]{{/defaultValue}} | +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} +## Example + +```python +from {{modelPackage}}.{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}} import {{classname}} + +# TODO update the JSON string below +json = "{}" +# create an instance of {{classname}} from a JSON string +{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_instance = {{classname}}.from_json(json) +# print the JSON string representation of the object +print({{classname}}.to_json()) + +# convert the object into a dict +{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict = {{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_instance.to_dict() +# create an instance of {{classname}} from a dict +{{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_from_dict = {{classname}}.from_dict({{#lambda.snakecase}}{{classname}}{{/lambda.snakecase}}_dict) +``` +{{/isEnum}} +{{#isEnum}} +## Enum +{{#allowableValues}}{{#enumVars}} +* `{{name}}` (value: `{{{value}}}`) +{{/enumVars}}{{/allowableValues}} +{{/isEnum}} +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}| `{{name}}`{{#required}}*_required_{{/required}} | {{#isPrimitiveType}}```{{{dataType}}}```{{/isPrimitiveType}}{{^isPrimitiveType}}[```{{{dataType}}}```]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{#isReadOnly}} [readonly]{{/isReadOnly}}{{#defaultValue}} [default to {{{.}}}]{{/defaultValue}} | +{{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +{{/useCustomTemplateCode}} -{{/model}}{{/models}} +{{/model}}{{/models}} \ No newline at end of file diff --git a/templates/model_enum.mustache b/templates/model_enum.mustache new file mode 100644 index 0000000..3f449b1 --- /dev/null +++ b/templates/model_enum.mustache @@ -0,0 +1,36 @@ +from __future__ import annotations +import json +from enum import Enum +{{#vendorExtensions.x-py-other-imports}} +{{{.}}} +{{/vendorExtensions.x-py-other-imports}} +from typing_extensions import Self + + +class {{classname}}({{vendorExtensions.x-py-enum-type}}, Enum): + """ + {{{description}}}{{^description}}{{{classname}}}{{/description}} + """ + + """ + allowed enum values + """ +{{#allowableValues}} + {{#enumVars}} + {{{name}}} = {{{value}}} + {{/enumVars}} + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of {{classname}} from a JSON string""" + return cls(json.loads(json_str)) + + {{#defaultValue}} + + # + @classmethod + def _missing_value_(cls, value): + if value is no_arg: + return cls.{{{.}}} + {{/defaultValue}} +{{/allowableValues}} diff --git a/templates/model_generic.mustache b/templates/model_generic.mustache new file mode 100644 index 0000000..6ffec53 --- /dev/null +++ b/templates/model_generic.mustache @@ -0,0 +1,470 @@ +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +{{#vendorExtensions.x-py-other-imports}} +{{{.}}} +{{/vendorExtensions.x-py-other-imports}} +{{#vendorExtensions.x-py-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-model-imports}} +{{^useCustomTemplateCode}} +from typing import Optional, Set +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +from typing import Optional, Set, Tuple +{{/useCustomTemplateCode}} +from typing_extensions import Self +{{#useCustomTemplateCode}} +import io +from pydantic import StrictBool +from typing import Union +{{/useCustomTemplateCode}} + +{{#hasChildren}} +{{#discriminator}} +{{! If this model is a super class, importlib is used. So import the necessary modules for the type here. }} +from typing import TYPE_CHECKING +if TYPE_CHECKING: +{{#mappedModels}} + from {{packageName}}.models.{{model.classVarName}} import {{modelName}} +{{/mappedModels}} + +{{/discriminator}} +{{/hasChildren}} +class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): + """ + {{#description}}{{{description}}}{{/description}}{{^description}}{{{classname}}}{{/description}} + """ # noqa: E501 +{{#vars}} +{{^useCustomTemplateCode}} + {{name}}: {{{vendorExtensions.x-py-typing}}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + {{name}}: {{#vendorExtensions.x-int-or-string}}Union[StrictStr, StrictInt{{#isNullable}}, None{{/isNullable}}]{{#description}} = Field(description="{{{description}}}"){{/description}}{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{vendorExtensions.x-py-typing}}}{{/vendorExtensions.x-int-or-string}} +{{/useCustomTemplateCode}} +{{/vars}} +{{#isAdditionalPropertiesTrue}} + additional_properties: Dict[str, Any] = {} +{{/isAdditionalPropertiesTrue}} + __properties: ClassVar[List[str]] = [{{#allVars}}"{{baseName}}"{{^-last}}, {{/-last}}{{/allVars}}] +{{#vars}} + {{#vendorExtensions.x-regex}} + + @field_validator('{{{name}}}') + def {{{name}}}_validate_regular_expression(cls, value): + """Validates the regular expression""" + {{^required}} + if value is None: + return value + + {{/required}} + {{#required}} + {{#isNullable}} + if value is None: + return value + + {{/isNullable}} + {{/required}} + if not re.match(r"{{{.}}}", value{{#vendorExtensions.x-modifiers}} ,re.{{{.}}}{{/vendorExtensions.x-modifiers}}): + raise ValueError(r"must validate the regular expression {{{vendorExtensions.x-pattern}}}") + return value + {{/vendorExtensions.x-regex}} + {{#isEnum}} + + @field_validator('{{{name}}}') + def {{{name}}}_validate_enum(cls, value): + """Validates the enum""" + {{^required}} + if value is None: + return value + + {{/required}} + {{#required}} + {{#isNullable}} + if value is None: + return value + + {{/isNullable}} + {{/required}} + {{#isArray}} + for i in value: + if i not in set([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]): + raise ValueError("each list item must be one of ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isArray}} + {{^isArray}} + if value not in set([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]): + raise ValueError("must be one of enum values ({{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}})") + {{/isArray}} + return value + {{/isEnum}} +{{/vars}} + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), +{{#useCustomTemplateCode}} + arbitrary_types_allowed=True, +{{/useCustomTemplateCode}} + ) + + +{{#hasChildren}} +{{#discriminator}} + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[str] = '{{discriminator.propertyBaseName}}' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + {{#mappedModels}}'{{{mappingName}}}': '{{{modelName}}}'{{^-last}},{{/-last}}{{/mappedModels}} + } + + @classmethod + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + +{{/discriminator}} +{{/hasChildren}} + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) +{{#useCustomTemplateCode}} + + def to_json_form_params(self, excluded_fields: Set[str] = None) -> List[Tuple[str, str]]: + data: List[Tuple[str, str]] = [] + + for key, value in self.to_dict(excluded_fields).items(): + if isinstance(value, (int, str, bool)): + data.append((key, value)) + else: + data.append((key, json.dumps(value, ensure_ascii=False))) + + return data +{{/useCustomTemplateCode}} + + @classmethod + def from_json(cls, json_str: str) -> Optional[{{^hasChildren}}Self{{/hasChildren}}{{#hasChildren}}{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}{{/hasChildren}}]: + """Create an instance of {{{classname}}} from a JSON string""" + return cls.from_dict(json.loads(json_str)) + +{{^useCustomTemplateCode}} + def to_dict(self) -> Dict[str, Any]: +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + def to_dict(self, excluded_fields: Set[str] = None) -> Dict[str, Any]: +{{/useCustomTemplateCode}} + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + {{#vendorExtensions.x-py-readonly}} + * OpenAPI `readOnly` fields are excluded. + {{/vendorExtensions.x-py-readonly}} + {{#isAdditionalPropertiesTrue}} + * Fields in `self.additional_properties` are added to the output dict. + {{/isAdditionalPropertiesTrue}} + """ +{{^useCustomTemplateCode}} + excluded_fields: Set[str] = set([ + {{#vendorExtensions.x-py-readonly}} + "{{{.}}}", + {{/vendorExtensions.x-py-readonly}} + {{#isAdditionalPropertiesTrue}} + "additional_properties", + {{/isAdditionalPropertiesTrue}} + ]) +{{/useCustomTemplateCode}} + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + {{#allVars}} + {{#isContainer}} + {{#isArray}} + {{#items.isArray}} + {{^items.items.isPrimitiveType}} + # override the default output from pydantic by calling `to_dict()` of each item in {{{name}}} (list of list) + _items = [] + if self.{{{name}}}: + for _item_{{{name}}} in self.{{{name}}}: + if _item_{{{name}}}: + _items.append( + [_inner_item.to_dict() for _inner_item in _item_{{{name}}} if _inner_item is not None] + ) + _dict['{{{baseName}}}'] = _items + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of each item in {{{name}}} (list) + _items = [] + if self.{{{name}}}: + for _item_{{{name}}} in self.{{{name}}}: + if _item_{{{name}}}: + _items.append(_item_{{{name}}}.to_dict()) + _dict['{{{baseName}}}'] = _items + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isArray}} + {{#isMap}} + {{#items.isArray}} + {{^items.items.isPrimitiveType}} + # override the default output from pydantic by calling `to_dict()` of each value in {{{name}}} (dict of array) + _field_dict_of_array = {} + if self.{{{name}}}: + for _key_{{{name}}} in self.{{{name}}}: + if self.{{{name}}}[_key_{{{name}}}] is not None: + _field_dict_of_array[_key_{{{name}}}] = [ + _item.to_dict() for _item in self.{{{name}}}[_key_{{{name}}}] + ] + _dict['{{{baseName}}}'] = _field_dict_of_array + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of each value in {{{name}}} (dict) + _field_dict = {} + if self.{{{name}}}: + for _key_{{{name}}} in self.{{{name}}}: + if self.{{{name}}}[_key_{{{name}}}]: + _field_dict[_key_{{{name}}}] = self.{{{name}}}[_key_{{{name}}}].to_dict() + _dict['{{{baseName}}}'] = _field_dict + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isMap}} + {{/isContainer}} + {{^isContainer}} + {{^isPrimitiveType}} + {{^isEnumOrRef}} + # override the default output from pydantic by calling `to_dict()` of {{{name}}} + if self.{{{name}}}: + _dict['{{{baseName}}}'] = self.{{{name}}}.to_dict() + {{/isEnumOrRef}} + {{/isPrimitiveType}} + {{/isContainer}} + {{/allVars}} + {{#isAdditionalPropertiesTrue}} + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + {{/isAdditionalPropertiesTrue}} +{{^useCustomTemplateCode}} + {{#allVars}} + {{#isNullable}} + # set to None if {{{name}}} (nullable) is None + # and model_fields_set contains the field + if self.{{name}} is None and "{{{name}}}" in self.model_fields_set: + _dict['{{{baseName}}}'] = None + + {{/isNullable}} + {{/allVars}} +{{/useCustomTemplateCode}} + return _dict + + {{#hasChildren}} + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Optional[{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}]: + """Create an instance of {{{classname}}} from a dict""" + {{#discriminator}} + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + {{#mappedModels}} + if object_type == '{{{modelName}}}': + return import_module("{{packageName}}.models.{{model.classVarName}}").{{modelName}}.from_dict(obj) + {{/mappedModels}} + + raise ValueError("{{{classname}}} failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + {{/discriminator}} + {{/hasChildren}} + {{^hasChildren}} + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of {{{classname}}} from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + {{#disallowAdditionalPropertiesIfNotPresent}} + {{^isAdditionalPropertiesTrue}} + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in {{classname}}) in the input: " + _key) + + {{/isAdditionalPropertiesTrue}} + {{/disallowAdditionalPropertiesIfNotPresent}} + _obj = cls.model_validate({ + {{#allVars}} + {{#isContainer}} + {{#isArray}} + {{#items.isArray}} + {{#items.items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.items.isPrimitiveType}} + {{^items.items.isPrimitiveType}} + "{{{baseName}}}": [ + [{{{items.items.dataType}}}.from_dict(_inner_item) for _inner_item in _item] + for _item in obj["{{{baseName}}}"] + ] if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/items.items.isPrimitiveType}} + {{/items.isArray}} + {{^items.isArray}} + {{^items.isPrimitiveType}} + {{#items.isEnumOrRef}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{^items.isEnumOrRef}} + "{{{baseName}}}": [{{{items.dataType}}}.from_dict(_item) for _item in obj["{{{baseName}}}"]] if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{#items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isPrimitiveType}} + {{/items.isArray}} + {{/isArray}} + {{#isMap}} + {{^items.isPrimitiveType}} + {{^items.isEnumOrRef}} + {{#items.isContainer}} + {{#items.isMap}} + "{{{baseName}}}": dict( + (_k, dict( + (_ik, {{{items.items.dataType}}}.from_dict(_iv)) + for _ik, _iv in _v.items() + ) + if _v is not None + else None + ) + for _k, _v in obj.get("{{{baseName}}}").items() + ) + if obj.get("{{{baseName}}}") is not None + else None{{^-last}},{{/-last}} + {{/items.isMap}} + {{#items.isArray}} + "{{{baseName}}}": dict( + (_k, + [{{{items.items.dataType}}}.from_dict(_item) for _item in _v] + if _v is not None + else None + ) + for _k, _v in obj.get("{{{baseName}}}", {}).items() + ){{^-last}},{{/-last}} + {{/items.isArray}} + {{/items.isContainer}} + {{^items.isContainer}} + "{{{baseName}}}": dict( + (_k, {{{items.dataType}}}.from_dict(_v)) + for _k, _v in obj["{{{baseName}}}"].items() + ) + if obj.get("{{{baseName}}}") is not None + else None{{^-last}},{{/-last}} + {{/items.isContainer}} + {{/items.isEnumOrRef}} + {{#items.isEnumOrRef}} + "{{{baseName}}}": dict((_k, _v) for _k, _v in obj.get("{{{baseName}}}").items()){{^-last}},{{/-last}} + {{/items.isEnumOrRef}} + {{/items.isPrimitiveType}} + {{#items.isPrimitiveType}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/items.isPrimitiveType}} + {{/isMap}} + {{/isContainer}} + {{^isContainer}} + {{^isPrimitiveType}} + {{^isEnumOrRef}} + "{{{baseName}}}": {{{dataType}}}.from_dict(obj["{{{baseName}}}"]) if obj.get("{{{baseName}}}") is not None else None{{^-last}},{{/-last}} + {{/isEnumOrRef}} + {{#isEnumOrRef}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{#defaultValue}} if obj.get("{{baseName}}") is not None else {{defaultValue}}{{/defaultValue}}{{^-last}},{{/-last}} + {{/isEnumOrRef}} + {{/isPrimitiveType}} + {{#isPrimitiveType}} + {{#defaultValue}} + "{{{baseName}}}": obj.get("{{{baseName}}}") if obj.get("{{{baseName}}}") is not None else {{{defaultValue}}}{{^-last}},{{/-last}} + {{/defaultValue}} + {{^defaultValue}} + "{{{baseName}}}": obj.get("{{{baseName}}}"){{^-last}},{{/-last}} + {{/defaultValue}} + {{/isPrimitiveType}} + {{/isContainer}} + {{/allVars}} + }) + {{#isAdditionalPropertiesTrue}} + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + {{/isAdditionalPropertiesTrue}} + return _obj + {{/hasChildren}} + +{{#useCustomTemplateCode}} +{{^discriminator}} + @classmethod + def init(cls, data: Any) -> Self: + """ + Attempt to instantiate and hydrate a new instance of this class + """ + if isinstance(data, str): + data = json.loads(data) + + return cls.from_dict(data) +{{/discriminator}} + + @classmethod + def openapi_types(cls) -> Dict[str, str]: + return { +{{#requiredVars}} + "{{name}}": "({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},)", +{{/requiredVars}} +{{#optionalVars}} + "{{name}}": "({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},)", +{{/optionalVars}} + } + + @classmethod + def openapi_type_is_array(cls, property_name: str) -> bool: + return property_name in [ + {{#vars}} + {{#isArray}} + "{{{name}}}", + {{/isArray}} + {{/vars}} + ] +{{/useCustomTemplateCode}} +{{#vendorExtensions.x-py-postponed-model-imports.size}} +{{#vendorExtensions.x-py-postponed-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-postponed-model-imports}} +# TODO: Rewrite to not use raise_errors +{{classname}}.model_rebuild(raise_errors=False) +{{/vendorExtensions.x-py-postponed-model-imports.size}} diff --git a/templates/model_oneof.mustache b/templates/model_oneof.mustache new file mode 100644 index 0000000..07a4d93 --- /dev/null +++ b/templates/model_oneof.mustache @@ -0,0 +1,209 @@ +from __future__ import annotations +import json +import pprint +{{#vendorExtensions.x-py-other-imports}} +{{{.}}} +{{/vendorExtensions.x-py-other-imports}} +{{#vendorExtensions.x-py-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-model-imports}} +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +{{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ONE_OF_SCHEMAS = [{{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}}] + +class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}): + """ + {{{description}}}{{^description}}{{{classname}}}{{/description}} + """ +{{#composedSchemas.oneOf}} + # data type: {{{dataType}}} + {{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}} +{{/composedSchemas.oneOf}} + actual_instance: Optional[Union[{{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}]] = None + one_of_schemas: Set[str] = { {{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}} } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + +{{#discriminator}} + + discriminator_value_class_map: Dict[str, str] = { +{{#children}} + '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},{{/-last}} +{{/children}} + } +{{/discriminator}} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + {{#isNullable}} + if v is None: + return v + + {{/isNullable}} + instance = {{{classname}}}.model_construct() + error_messages = [] + match = 0 + {{#composedSchemas.oneOf}} + # validate data type: {{{dataType}}} + {{#isContainer}} + try: + instance.{{vendorExtensions.x-py-name}} = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isContainer}} + {{^isContainer}} + {{#isPrimitiveType}} + try: + instance.{{vendorExtensions.x-py-name}} = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if not isinstance(v, {{{dataType}}}): + error_messages.append(f"Error! Input type `{type(v)}` is not `{{{dataType}}}`") + else: + match += 1 + {{/isPrimitiveType}} + {{/isContainer}} + {{/composedSchemas.oneOf}} + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + {{#isNullable}} + def from_json(cls, json_str: Optional[str]) -> Self: + {{/isNullable}} + {{^isNullable}} + def from_json(cls, json_str: str) -> Self: + {{/isNullable}} + """Returns the object represented by the json string""" + instance = cls.model_construct() + {{#isNullable}} + if json_str is None: + return instance + + {{/isNullable}} + error_messages = [] + match = 0 + + {{#useOneOfDiscriminatorLookup}} + {{#discriminator}} + {{#mappedModels}} + {{#-first}} + # use oneOf discriminator to lookup the data type + _data_type = json.loads(json_str).get("{{{propertyBaseName}}}") + if not _data_type: + raise ValueError("Failed to lookup data type from the field `{{{propertyBaseName}}}` in the input.") + + {{/-first}} + # check if data type is `{{{modelName}}}` + if _data_type == "{{{mappingName}}}": + instance.actual_instance = {{{modelName}}}.from_json(json_str) + return instance + + {{/mappedModels}} + {{/discriminator}} + {{/useOneOfDiscriminatorLookup}} + {{#composedSchemas.oneOf}} + {{#isContainer}} + # deserialize data into {{{dataType}}} + try: + # validation + instance.{{vendorExtensions.x-py-name}} = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.{{vendorExtensions.x-py-name}} + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isContainer}} + {{^isContainer}} + {{#isPrimitiveType}} + # deserialize data into {{{dataType}}} + try: + # validation + instance.{{vendorExtensions.x-py-name}} = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.{{vendorExtensions.x-py-name}} + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{^isPrimitiveType}} + # deserialize data into {{{dataType}}} + try: + instance.actual_instance = {{{dataType}}}.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + {{/isPrimitiveType}} + {{/isContainer}} + {{/composedSchemas.oneOf}} + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + +{{#vendorExtensions.x-py-postponed-model-imports.size}} +{{#vendorExtensions.x-py-postponed-model-imports}} +{{{.}}} +{{/vendorExtensions.x-py-postponed-model-imports}} +# TODO: Rewrite to not use raise_errors +{{classname}}.model_rebuild(raise_errors=False) +{{/vendorExtensions.x-py-postponed-model-imports.size}} diff --git a/templates/model_templates/classvars.mustache b/templates/model_templates/classvars.mustache deleted file mode 100644 index e22c33e..0000000 --- a/templates/model_templates/classvars.mustache +++ /dev/null @@ -1,157 +0,0 @@ - allowed_values = { -{{#isEnum}} - ('value',): { -{{#isNullable}} - 'None': None, -{{/isNullable}} -{{#allowableValues}} -{{#enumVars}} - '{{name}}': {{{value}}}, -{{/enumVars}} -{{/allowableValues}} - }, -{{/isEnum}} -{{#requiredVars}} -{{#isEnum}} - ('{{name}}',): { -{{#isNullable}} - 'None': None, -{{/isNullable}} -{{#allowableValues}} -{{#enumVars}} - '{{name}}': {{{value}}}, -{{/enumVars}} -{{/allowableValues}} - }, -{{/isEnum}} -{{/requiredVars}} -{{#optionalVars}} -{{#isEnum}} - ('{{name}}',): { -{{#isNullable}} - 'None': None, -{{/isNullable}} -{{#allowableValues}} -{{#enumVars}} - '{{name}}': {{{value}}}, -{{/enumVars}} -{{/allowableValues}} - }, -{{/isEnum}} -{{/optionalVars}} - } - - validations = { -{{#hasValidation}} - ('value',): { -{{> model_templates/validations }} -{{/hasValidation}} -{{#requiredVars}} -{{#hasValidation}} - ('{{name}}',): { -{{> model_templates/validations }} -{{/hasValidation}} -{{/requiredVars}} -{{#optionalVars}} -{{#hasValidation}} - ('{{name}}',): { -{{> model_templates/validations }} -{{/hasValidation}} -{{/optionalVars}} - } - -{{#additionalProperties}} - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ -{{#discriminator}} -{{^imports}} - lazy_import() -{{/imports}} -{{/discriminator}} -{{#imports}} -{{#-first}} - lazy_import() -{{/-first}} -{{/imports}} - return ({{{dataType}}},) # noqa: E501 -{{/additionalProperties}} -{{^additionalProperties}} - additional_properties_type = None -{{/additionalProperties}} - - _nullable = {{#isNullable}}True{{/isNullable}}{{^isNullable}}False{{/isNullable}} - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ -{{#discriminator}} -{{^imports}} - lazy_import() -{{/imports}} -{{/discriminator}} -{{#imports}} -{{#-first}} - lazy_import() -{{/-first}} -{{/imports}} - return { -{{#isAlias}} - 'value': ({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},), -{{/isAlias}} -{{#isEnum}} - 'value': ({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},), -{{/isEnum}} -{{#isArray}} - 'value': ({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},), -{{/isArray}} -{{#requiredVars}} - '{{name}}': ({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},), # noqa: E501 -{{/requiredVars}} -{{#optionalVars}} - '{{name}}': ({{#vendorExtensions.x-int-or-string}}int, str{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}},), # noqa: E501 -{{/optionalVars}} - } - - @cached_property - def discriminator(): -{{^discriminator}} - return None -{{/discriminator}} -{{#discriminator}} - lazy_import() - val = { -{{#mappedModels}} - '{{mappingName}}': {{{modelName}}}, -{{/mappedModels}} - } - if not val: - return None - return {'{{{discriminatorName}}}': val}{{/discriminator}} -{{^discriminator}} - @staticmethod - def init(data: any) -> {{classname}}: - """ - Attempt to instantiate and hydrate a new instance of this class - """ - try: - obj_data = json.dumps(data) - except TypeError: - obj_data = data - - return ApiClient().deserialize( - response=type('obj_dict', (object,), {'data': obj_data}), - response_type=[{{classname}}], - _check_type=True, - ) -{{/discriminator}} diff --git a/templates/model_templates/docstring_allowed.mustache b/templates/model_templates/docstring_allowed.mustache deleted file mode 100644 index ab20932..0000000 --- a/templates/model_templates/docstring_allowed.mustache +++ /dev/null @@ -1,4 +0,0 @@ - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. \ No newline at end of file diff --git a/templates/model_templates/docstring_init_required_kwargs.mustache b/templates/model_templates/docstring_init_required_kwargs.mustache deleted file mode 100644 index a9abdf1..0000000 --- a/templates/model_templates/docstring_init_required_kwargs.mustache +++ /dev/null @@ -1,30 +0,0 @@ - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) \ No newline at end of file diff --git a/templates/model_templates/docstring_openapi_validations.mustache b/templates/model_templates/docstring_openapi_validations.mustache deleted file mode 100644 index f933b86..0000000 --- a/templates/model_templates/docstring_openapi_validations.mustache +++ /dev/null @@ -1,7 +0,0 @@ - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. \ No newline at end of file diff --git a/templates/model_templates/invalid_pos_args.mustache b/templates/model_templates/invalid_pos_args.mustache deleted file mode 100644 index 143d50c..0000000 --- a/templates/model_templates/invalid_pos_args.mustache +++ /dev/null @@ -1,9 +0,0 @@ - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) \ No newline at end of file diff --git a/templates/model_templates/method_from_openapi_data_composed.mustache b/templates/model_templates/method_from_openapi_data_composed.mustache deleted file mode 100644 index ad21665..0000000 --- a/templates/model_templates/method_from_openapi_data_composed.mustache +++ /dev/null @@ -1,66 +0,0 @@ - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """{{classname}} - a model defined in OpenAPI - - Keyword Args: -{{#requiredVars}} -{{#defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{^defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - - return self \ No newline at end of file diff --git a/templates/model_templates/method_from_openapi_data_normal.mustache b/templates/model_templates/method_from_openapi_data_normal.mustache deleted file mode 100644 index 3b82ba7..0000000 --- a/templates/model_templates/method_from_openapi_data_normal.mustache +++ /dev/null @@ -1,17 +0,0 @@ -{{> model_templates/method_from_openapi_data_shared }} - -{{#isEnum}} - self.value = value -{{/isEnum}} -{{#requiredVars}} - self.{{name}} = {{name}} -{{/requiredVars}} - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self \ No newline at end of file diff --git a/templates/model_templates/method_from_openapi_data_shared.mustache b/templates/model_templates/method_from_openapi_data_shared.mustache deleted file mode 100644 index 4b9335f..0000000 --- a/templates/model_templates/method_from_openapi_data_shared.mustache +++ /dev/null @@ -1,49 +0,0 @@ - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls{{#requiredVars}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/requiredVars}}, *args, **kwargs): # noqa: E501 - """{{classname}} - a model defined in OpenAPI - -{{#requiredVars}} -{{#-first}} - Args: -{{/-first}} -{{^defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{#-last}} - -{{/-last}} -{{/requiredVars}} - Keyword Args: -{{#requiredVars}} -{{#defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) \ No newline at end of file diff --git a/templates/model_templates/method_from_openapi_data_simple.mustache b/templates/model_templates/method_from_openapi_data_simple.mustache deleted file mode 100644 index 11f237c..0000000 --- a/templates/model_templates/method_from_openapi_data_simple.mustache +++ /dev/null @@ -1,62 +0,0 @@ - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """{{classname}} - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 - - Keyword Args: - value ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{> model_templates/docstring_init_required_kwargs }} - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) -{{#defaultValue}} - else: - value = {{{.}}} -{{/defaultValue}} -{{^defaultValue}} - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) -{{/defaultValue}} - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self \ No newline at end of file diff --git a/templates/model_templates/method_init_composed.mustache b/templates/model_templates/method_init_composed.mustache deleted file mode 100644 index 15d83c9..0000000 --- a/templates/model_templates/method_init_composed.mustache +++ /dev/null @@ -1,80 +0,0 @@ - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - '_composed_instances', - '_var_name_to_model_instances', - '_additional_properties_model_instances', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """{{classname}} - a model defined in OpenAPI - - Keyword Args: -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{^defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - '_check_type': _check_type, - '_path_to_item': _path_to_item, - '_spec_property_naming': _spec_property_naming, - '_configuration': _configuration, - '_visited_composed_classes': self._visited_composed_classes, - } - composed_info = validate_get_composed_info( - constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if var_name in discarded_args and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self._additional_properties_model_instances: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") \ No newline at end of file diff --git a/templates/model_templates/method_init_normal.mustache b/templates/model_templates/method_init_normal.mustache deleted file mode 100644 index bc5e768..0000000 --- a/templates/model_templates/method_init_normal.mustache +++ /dev/null @@ -1,30 +0,0 @@ - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - -{{> model_templates/method_init_shared }} - -{{#isEnum}} - self.value = value -{{/isEnum}} -{{#requiredVars}} -{{^isReadOnly}} - self.{{name}} = {{name}} -{{/isReadOnly}} -{{/requiredVars}} - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") \ No newline at end of file diff --git a/templates/model_templates/method_init_shared.mustache b/templates/model_templates/method_init_shared.mustache deleted file mode 100644 index 9debb40..0000000 --- a/templates/model_templates/method_init_shared.mustache +++ /dev/null @@ -1,52 +0,0 @@ - @convert_js_args_to_python_args - def __init__(self{{#requiredVars}}{{^isReadOnly}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/isReadOnly}}{{/requiredVars}}, *args, **kwargs): # noqa: E501 - """{{classname}} - a model defined in OpenAPI - -{{#requiredVars}} -{{^isReadOnly}} -{{#-first}} - Args: -{{/-first}} -{{^defaultValue}} - {{name}} ({{#vendorExtensions.x-int-or-string}}str|int{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}):{{#description}} {{{.}}}{{/description}} -{{/defaultValue}} -{{#-last}} - -{{/-last}} -{{/isReadOnly}} -{{/requiredVars}} - Keyword Args: -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} -{{#optionalVars}} - {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 -{{/optionalVars}} - """ - -{{#requiredVars}} -{{^isReadOnly}} -{{#defaultValue}} - {{name}} = kwargs.get('{{name}}', {{{defaultValue}}}) -{{/defaultValue}} -{{/isReadOnly}} -{{/requiredVars}} - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) \ No newline at end of file diff --git a/templates/model_templates/method_init_simple.mustache b/templates/model_templates/method_init_simple.mustache deleted file mode 100644 index ec111f6..0000000 --- a/templates/model_templates/method_init_simple.mustache +++ /dev/null @@ -1,66 +0,0 @@ - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """{{classname}} - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 - - Keyword Args: - value ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{.}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 -{{> model_templates/docstring_init_required_kwargs }} - """ - # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) - - if 'value' in kwargs: - value = kwargs.pop('value') - elif args: - args = list(args) - value = args.pop(0) -{{#defaultValue}} - else: - value = {{{.}}} -{{/defaultValue}} -{{^defaultValue}} - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) -{{/defaultValue}} - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - -{{> model_templates/invalid_pos_args }} - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) \ No newline at end of file diff --git a/templates/model_templates/method_set_attribute.mustache b/templates/model_templates/method_set_attribute.mustache deleted file mode 100644 index 8ba0529..0000000 --- a/templates/model_templates/method_set_attribute.mustache +++ /dev/null @@ -1,51 +0,0 @@ - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - self.__dict__['_data_store'][name] = value \ No newline at end of file diff --git a/templates/model_templates/methods_setattr_getattr_composed.mustache b/templates/model_templates/methods_setattr_getattr_composed.mustache deleted file mode 100644 index ada739e..0000000 --- a/templates/model_templates/methods_setattr_getattr_composed.mustache +++ /dev/null @@ -1,103 +0,0 @@ - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False \ No newline at end of file diff --git a/templates/model_templates/methods_setattr_getattr_normal.mustache b/templates/model_templates/methods_setattr_getattr_normal.mustache deleted file mode 100644 index 9540c19..0000000 --- a/templates/model_templates/methods_setattr_getattr_normal.mustache +++ /dev/null @@ -1,28 +0,0 @@ - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - return None - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] \ No newline at end of file diff --git a/templates/model_templates/methods_shared.mustache b/templates/model_templates/methods_shared.mustache deleted file mode 100644 index eddad25..0000000 --- a/templates/model_templates/methods_shared.mustache +++ /dev/null @@ -1,34 +0,0 @@ - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.{{#attrNoneIfUnset}}get{{/attrNoneIfUnset}}{{^attrNoneIfUnset}}__getitem__{{/attrNoneIfUnset}}(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return new_cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst diff --git a/templates/model_templates/methods_todict_tostr_eq_shared.mustache b/templates/model_templates/methods_todict_tostr_eq_shared.mustache deleted file mode 100644 index 17c4411..0000000 --- a/templates/model_templates/methods_todict_tostr_eq_shared.mustache +++ /dev/null @@ -1,24 +0,0 @@ - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True \ No newline at end of file diff --git a/templates/model_templates/methods_tostr_eq_simple.mustache b/templates/model_templates/methods_tostr_eq_simple.mustache deleted file mode 100644 index 4a7ef6a..0000000 --- a/templates/model_templates/methods_tostr_eq_simple.mustache +++ /dev/null @@ -1,16 +0,0 @@ - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal \ No newline at end of file diff --git a/templates/model_templates/model_composed.mustache b/templates/model_templates/model_composed.mustache deleted file mode 100644 index 92c528d..0000000 --- a/templates/model_templates/model_composed.mustache +++ /dev/null @@ -1,91 +0,0 @@ -class {{classname}}(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: -{{> model_templates/docstring_allowed }} - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. -{{> model_templates/docstring_openapi_validations }} - """ - -{{> model_templates/classvars }} - - attribute_map = { -{{#requiredVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/requiredVars}} -{{#optionalVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/optionalVars}} - } - - read_only_vars = { -{{#requiredVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/requiredVars}} -{{#optionalVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/optionalVars}} - } - {{#requiredVars}} - - @property - def {{name}}(self) -> {{#vendorExtensions.x-int-or-string}}Union[int, str]{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}: - return self.get("{{name}}") - {{^isReadOnly}} - - @{{name}}.setter - def {{name}}(self, value: {{#vendorExtensions.x-int-or-string}}Union[int, str]{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}): - setattr(self, "{{name}}", value) - {{/isReadOnly}} - {{/requiredVars}} - {{#optionalVars}} - - @property - def {{name}}(self) -> {{{dataType}}}: - return self.get("{{name}}") - - @{{name}}.setter - def {{name}}(self, value: {{{dataType}}}): - setattr(self, "{{name}}", value) - {{/optionalVars}} - -{{> model_templates/method_from_openapi_data_composed }} - -{{> model_templates/method_init_composed }} - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading -{{#imports}} -{{#-first}} - lazy_import() -{{/-first}} -{{/imports}} - return { - 'anyOf': [ -{{#anyOf}} - {{{.}}}, -{{/anyOf}} - ], - 'oneOf': [ -{{#oneOf}} - {{{.}}}, -{{/oneOf}} - ], - } \ No newline at end of file diff --git a/templates/model_templates/model_normal.mustache b/templates/model_templates/model_normal.mustache deleted file mode 100644 index e1e0ca3..0000000 --- a/templates/model_templates/model_normal.mustache +++ /dev/null @@ -1,65 +0,0 @@ -class {{classname}}(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: -{{> model_templates/docstring_allowed }} - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. -{{> model_templates/docstring_openapi_validations }} - """ - -{{> model_templates/classvars }} - attribute_map = { -{{#requiredVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/requiredVars}} -{{#optionalVars}} - '{{name}}': '{{baseName}}', # noqa: E501 -{{/optionalVars}} - } - - read_only_vars = { -{{#requiredVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/requiredVars}} -{{#optionalVars}} -{{#isReadOnly}} - '{{name}}', # noqa: E501 -{{/isReadOnly}} -{{/optionalVars}} - } - - _composed_schemas = {} - {{#requiredVars}} - - @property - def {{name}}(self) -> {{#vendorExtensions.x-int-or-string}}Union[int, str]{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}: - return self.get("{{name}}") - {{^isReadOnly}} - - @{{name}}.setter - def {{name}}(self, value: {{#vendorExtensions.x-int-or-string}}Union[int, str]{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{dataType}}}{{/vendorExtensions.x-int-or-string}}): - setattr(self, "{{name}}", value) - {{/isReadOnly}} - {{/requiredVars}} - {{#optionalVars}} - - @property - def {{name}}(self) -> {{{dataType}}}: - return self.get("{{name}}") - - @{{name}}.setter - def {{name}}(self, value: {{{dataType}}}): - setattr(self, "{{name}}", value) - {{/optionalVars}} - -{{> model_templates/method_from_openapi_data_normal}} - -{{> model_templates/method_init_normal}} \ No newline at end of file diff --git a/templates/model_templates/model_simple.mustache b/templates/model_templates/model_simple.mustache deleted file mode 100644 index 1a41a9c..0000000 --- a/templates/model_templates/model_simple.mustache +++ /dev/null @@ -1,22 +0,0 @@ -class {{classname}}(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: -{{> model_templates/docstring_allowed }} -{{> model_templates/docstring_openapi_validations }} - """ - -{{> model_templates/classvars }} - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - -{{> model_templates/method_init_simple}} - -{{> model_templates/method_from_openapi_data_simple}} \ No newline at end of file diff --git a/templates/model_templates/validations.mustache b/templates/model_templates/validations.mustache deleted file mode 100644 index 758dc41..0000000 --- a/templates/model_templates/validations.mustache +++ /dev/null @@ -1,34 +0,0 @@ -{{#maxLength}} - 'max_length': {{.}}, -{{/maxLength}} -{{#minLength}} - 'min_length': {{.}}, -{{/minLength}} -{{#maxItems}} - 'max_items': {{.}}, -{{/maxItems}} -{{#minProperties}} - 'min_properties': {{.}}, -{{/minProperties}} -{{#maxProperties}} - 'max_properties': {{.}}, -{{/maxProperties}} -{{#minItems}} - 'min_items': {{.}}, -{{/minItems}} -{{#maximum}} - {{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}'inclusive_maximum': {{maximum}}, -{{/maximum}} -{{#minimum}} - {{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}'inclusive_minimum': {{minimum}}, -{{/minimum}} -{{#pattern}} - 'regex': { - 'pattern': r'{{{vendorExtensions.x-regex}}}', # noqa: E501{{#vendorExtensions.x-modifiers}} - {{#-first}}'flags': (re.{{.}}{{/-first}}{{^-first}} re.{{.}}{{/-first}}{{^-last}} | {{/-last}}{{#-last}}){{/-last}}{{/vendorExtensions.x-modifiers}} - }, -{{/pattern}} -{{#multipleOf}} - 'multiple_of': {{.}}, -{{/multipleOf}} - }, \ No newline at end of file diff --git a/templates/model_test.mustache b/templates/model_test.mustache index aa95f64..0808855 100644 --- a/templates/model_test.mustache +++ b/templates/model_test.mustache @@ -1,17 +1,13 @@ +# coding: utf-8 + {{>partial_header}} -import sys import unittest -import {{packageName}} {{#models}} {{#model}} -{{#imports}} -{{{.}}} -{{/imports}} from {{modelPackage}}.{{classFilename}} import {{classname}} - class Test{{classname}}(unittest.TestCase): """{{classname}} unit test stubs""" @@ -20,13 +16,42 @@ class Test{{classname}}(unittest.TestCase): def tearDown(self): pass +{{^isEnum}} + + def make_instance(self, include_optional) -> {{classname}}: + """Test {{classname}} + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `{{{classname}}}` + """ + model = {{classname}}() + if include_optional: + return {{classname}}( + {{#vars}} + {{name}} = {{{example}}}{{^example}}None{{/example}}{{^-last}},{{/-last}} + {{/vars}} + ) + else: + return {{classname}}( + {{#vars}} + {{#required}} + {{name}} = {{{example}}}{{^example}}None{{/example}}, + {{/required}} + {{/vars}} + ) + """ +{{/isEnum}} def test{{classname}}(self): """Test {{classname}}""" - # FIXME: construct object with mandatory attributes with example values - # model = {{classname}}() # noqa: E501 - pass - +{{^isEnum}} + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) +{{/isEnum}} +{{#isEnum}} + # inst = {{{classname}}}() +{{/isEnum}} {{/model}} {{/models}} diff --git a/templates/model_utils.mustache b/templates/model_utils.mustache deleted file mode 100644 index c92ed19..0000000 --- a/templates/model_utils.mustache +++ /dev/null @@ -1,1732 +0,0 @@ -{{>partial_header}} - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile - -from dateutil.parser import parse - -from {{packageName}}.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - -{{> model_templates/method_set_attribute }} - -{{> model_templates/methods_shared }} - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - -{{> model_templates/methods_setattr_getattr_normal }} - -{{> model_templates/methods_tostr_eq_simple }} - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - -{{> model_templates/methods_setattr_getattr_normal }} - -{{> model_templates/methods_todict_tostr_eq_shared}} - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - -{{> model_templates/methods_setattr_getattr_composed }} - -{{> model_templates/methods_todict_tostr_eq_shared}} - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - # leave ints as-is - if type(current_item) is int and required_type_class_simplified == current_type_simple: - results_classes.append(int) - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - - # allow casting int to string - if type(current_item) is int: - results_classes.append(str) - - if type(current_item) is none_type: - results_classes.append(none_type) - return results_classes - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - elif data is None: - # This SDK does not support nullable params unless they are explicitly marked as nullable - return data - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - if input_value is None: - return input_value - - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if configuration: - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item - - model_instances = [model_instance] - if model_instance._composed_schemas: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - result[attr] = model_to_dict_recursive(value, serialize, extract_item) - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def model_to_dict_recursive(value, serialize, extract_item): - if isinstance(value, list): - res = [] - - for v in value: - res.append(model_to_dict_recursive(v, serialize, extract_item)) - - return res - elif isinstance(value, dict): - return dict(map( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - return value.value - elif hasattr(value, '_data_store'): - return model_to_dict(value, serialize=serialize) - elif isinstance(value, io.BufferedReader): - return value.name - else: - return value - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - if 'allOf' in self._composed_schemas.keys(): - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data(**model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data(model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + composed_instances - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] \ No newline at end of file diff --git a/templates/partial_api.mustache b/templates/partial_api.mustache new file mode 100644 index 0000000..dd3a9a1 --- /dev/null +++ b/templates/partial_api.mustache @@ -0,0 +1,52 @@ + """{{#isDeprecated}}(Deprecated) {{/isDeprecated}}{{{summary}}}{{^summary}}{{operationId}}{{/summary}} + + {{#notes}} + {{{.}}} + {{/notes}} + + {{#allParams}} + :param {{paramName}}:{{#description}} {{{.}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}} + :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}} + {{/allParams}} + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + {{#isDeprecated}} + warnings.warn("{{{httpMethod}}} {{{path}}} is deprecated.", DeprecationWarning) + {{/isDeprecated}} + + _param = self._{{operationId}}_serialize( + {{#allParams}} + {{paramName}}={{paramName}}, + {{/allParams}} + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + {{#responses}} + {{^isWildcard}} + '{{code}}': {{#dataType}}"{{.}}"{{/dataType}}{{^dataType}}None{{/dataType}}, + {{/isWildcard}} + {{/responses}} + } \ No newline at end of file diff --git a/templates/partial_api_args.mustache b/templates/partial_api_args.mustache new file mode 100644 index 0000000..379b67d --- /dev/null +++ b/templates/partial_api_args.mustache @@ -0,0 +1,18 @@ +( + self, + {{#allParams}} + {{paramName}}: {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}}, + {{/allParams}} + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le={{#servers.size}}{{servers.size}}{{/servers.size}}{{^servers.size}}1{{/servers.size}})] = 0, + ) \ No newline at end of file diff --git a/templates/partial_header.mustache b/templates/partial_header.mustache index dc3c8f3..50aa811 100644 --- a/templates/partial_header.mustache +++ b/templates/partial_header.mustache @@ -1,17 +1,19 @@ """ {{#appName}} {{{.}}} -{{/appName}} +{{/appName}} {{#appDescription}} - {{{.}}} # noqa: E501 -{{/appDescription}} + {{{.}}} +{{/appDescription}} {{#version}} The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} Contact: {{{.}}} {{/infoEmail}} - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 diff --git a/templates/py.typed.mustache b/templates/py.typed.mustache new file mode 100644 index 0000000..e69de29 diff --git a/templates/pyproject.mustache b/templates/pyproject.mustache new file mode 100644 index 0000000..24030f9 --- /dev/null +++ b/templates/pyproject.mustache @@ -0,0 +1,82 @@ +[tool.poetry] +name = "{{{packageName}}}" +version = "{{{packageVersion}}}" +description = "{{{appName}}}" +authors = ["{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}} <{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}>"] +license = "{{{licenseInfo}}}{{^licenseInfo}}NoLicense{{/licenseInfo}}" +readme = "README.md" +repository = "https://github.com/{{{gitUserId}}}/{{{gitRepoId}}}" +keywords = ["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"] +include = ["{{packageName}}/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +{{#asyncio}} +aiohttp = ">= 3.8.4" +aiohttp-retry = ">= 2.8.3" +{{/asyncio}} +{{#tornado}} +tornado = ">=4.2,<5" +{{/tornado}} +{{#hasHttpSignatureMethods}} +pem = ">= 19.3.0" +pycryptodome = ">= 3.9.0" +{{/hasHttpSignatureMethods}} +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" +types-python-dateutil = ">=2.8.19.14" +mypy = "1.4.1" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "{{{packageName}}}", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/templates/python_doc_auth_partial.mustache b/templates/python_doc_auth_partial.mustache index 5106632..f478fe0 100644 --- a/templates/python_doc_auth_partial.mustache +++ b/templates/python_doc_auth_partial.mustache @@ -15,15 +15,15 @@ configuration = {{{packageName}}}.Configuration( # Configure HTTP basic authorization: {{{name}}} configuration = {{{packageName}}}.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] ) {{/isBasicBasic}} {{#isBasicBearer}} # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} configuration = {{{packageName}}}.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) {{/isBasicBearer}} {{#isHttpSignature}} @@ -64,9 +64,12 @@ configuration = {{{packageName}}}.Configuration( # the API server. # # See {{{packageName}}}.signing for a list of all supported parameters. +from {{{packageName}}} import signing +import datetime + configuration = {{{packageName}}}.Configuration( host = "{{{basePath}}}", - signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( + signing_info = {{{packageName}}}.HttpSigningConfiguration( key_id = 'my-key-id', private_key_path = 'private_key.pem', private_key_passphrase = 'YOUR_PASSPHRASE', @@ -92,18 +95,14 @@ configuration = {{{packageName}}}.Configuration( {{#isApiKey}} # Configure API key authorization: {{{name}}} -configuration.api_key['{{{name}}}'] = 'YOUR_API_KEY' +configuration.api_key['{{{name}}}'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['{{name}}'] = 'Bearer' {{/isApiKey}} {{#isOAuth}} -# Configure OAuth2 access token for authorization: {{{name}}} -configuration = {{{packageName}}}.Configuration( - host = "{{{basePath}}}" -) -configuration.access_token = 'YOUR_ACCESS_TOKEN' +configuration.access_token = os.environ["ACCESS_TOKEN"] {{/isOAuth}} {{/authMethods}} {{/hasAuthMethods}} diff --git a/templates/requirements.mustache b/templates/requirements.mustache index 96947f6..5412515 100644 --- a/templates/requirements.mustache +++ b/templates/requirements.mustache @@ -1,3 +1,12 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 +{{#asyncio}} +aiohttp >= 3.0.0 +aiohttp-retry >= 2.8.3 +{{/asyncio}} +{{#hasHttpSignatureMethods}} +pycryptodome >= 3.9.0 +{{/hasHttpSignatureMethods}} diff --git a/templates/rest.mustache b/templates/rest.mustache index a667402..07aa7ee 100644 --- a/templates/rest.mustache +++ b/templates/rest.mustache @@ -1,46 +1,58 @@ +# coding: utf-8 + {{>partial_header}} import io import json -import logging import re import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment + import urllib3 -import ipaddress -from {{packageName}}.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from {{packageName}}.exceptions import ApiException, ApiValueError +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -49,70 +61,79 @@ class RESTClientObject(object): else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager - if configuration.proxy and not should_bypass_proxies(configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -124,60 +145,83 @@ class RESTClientObject(object): timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', headers['Content-Type'], re.IGNORECASE)): + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: - request_body = json.dumps(body) + request_body = json.dumps(body{{#setEnsureAsciiToFalse}}, ensure_ascii=False{{/setEnsureAsciiToFalse}}) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -188,151 +232,16 @@ class RESTClientObject(object): raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None , '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ',''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} ) + return RESTResponse(r) diff --git a/templates/setup.mustache b/templates/setup.mustache index 3d88fb3..ec5a2ef 100644 --- a/templates/setup.mustache +++ b/templates/setup.mustache @@ -1,53 +1,75 @@ +# coding: utf-8 + {{>partial_header}} from setuptools import setup, find_packages # noqa: H301 +{{#useCustomTemplateCode}} from pathlib import Path +{{/useCustomTemplateCode}} -NAME = "{{{projectName}}}" -VERSION = "{{packageVersion}}" -{{#apiInfo}} -{{#apis}} -{{#-last}} # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools - +NAME = "{{{projectName}}}" +VERSION = "{{packageVersion}}" +PYTHON_REQUIRES = ">=3.7" +{{#apiInfo}} +{{#apis}} +{{#-last}} REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", {{#asyncio}} - "aiohttp >= 3.0.0", + "aiohttp >= 3.0.0", + "aiohttp-retry >= 2.8.3", {{/asyncio}} {{#tornado}} - "tornado>=4.2,<5", + "tornado>=4.2,<5", {{/tornado}} {{#hasHttpSignatureMethods}} - "pem>=19.3.0", - "pycryptodome>=3.9.0", + "pem>=19.3.0", + "pycryptodome>=3.9.0", {{/hasHttpSignatureMethods}} + "pydantic >= 2", + "typing-extensions >= 4.7.1", ] +{{#useCustomTemplateCode}} this_directory = Path(__file__).parent long_description = (this_directory / "README.md").read_text() +{{/useCustomTemplateCode}} setup( name=NAME, version=VERSION, description="{{appName}}", +{{^useCustomTemplateCode}} + author="{{infoName}}{{^infoName}}OpenAPI Generator community{{/infoName}}", +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} author="{{packageAuthor}}", +{{/useCustomTemplateCode}} author_email="{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", url="{{packageUrl}}", keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], - python_requires="{{{generatorLanguageVersion}}}", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, +{{^useCustomTemplateCode}} + {{#licenseInfo}}license="{{.}}", + {{/licenseInfo}}long_description="""\ + {{appDescription}} # noqa: E501 + """ +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#licenseInfo}}license="{{.}}", {{/licenseInfo}}long_description=long_description, - long_description_content_type='text/markdown' + long_description_content_type='text/markdown', +{{/useCustomTemplateCode}} + package_data={"{{{packageName}}}": ["py.typed"]}, ) {{/-last}} {{/apis}} diff --git a/templates/setup_cfg.mustache b/templates/setup_cfg.mustache index 931f02c..11433ee 100644 --- a/templates/setup_cfg.mustache +++ b/templates/setup_cfg.mustache @@ -1,13 +1,2 @@ -{{#useNose}} -[nosetests] -logging-clear-handlers=true -verbosity=2 -randomize=true -exe=true -with-coverage=true -cover-package={{{packageName}}} -cover-erase=true - -{{/useNose}} [flake8] max-line-length=99 diff --git a/templates/signing.mustache b/templates/signing.mustache index e39866a..4d00424 100644 --- a/templates/signing.mustache +++ b/templates/signing.mustache @@ -3,13 +3,16 @@ from base64 import b64encode from Crypto.IO import PEM, PKCS8 from Crypto.Hash import SHA256, SHA512 +from Crypto.Hash.SHA512 import SHA512Hash +from Crypto.Hash.SHA256 import SHA256Hash from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS +from datetime import timedelta from email.utils import formatdate -import json import os import re from time import time +from typing import List, Optional, Union from urllib.parse import urlencode, urlparse # The constants below define a subset of HTTP headers that can be included in the @@ -56,25 +59,22 @@ HASH_SHA256 = 'sha256' HASH_SHA512 = 'sha512' -class HttpSigningConfiguration(object): +class HttpSigningConfiguration: """The configuration parameters for the HTTP signature security scheme. + The HTTP signature security scheme is used to sign HTTP requests with a private key which is in possession of the API client. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key. The 'Authorization' header is added to outbound HTTP requests. - NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. + An ``Authorization`` header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key. The ``Authorization`` header is added to outbound HTTP requests. :param key_id: A string value specifying the identifier of the cryptographic key, when signing HTTP requests. :param signing_scheme: A string value specifying the signature scheme, when signing HTTP requests. - Supported value are hs2019, rsa-sha256, rsa-sha512. - Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are + Supported value are: ``hs2019``, ``rsa-sha256``, ``rsa-sha512``. + Avoid using ``rsa-sha256``, ``rsa-sha512`` as they are deprecated. These values are available for server-side applications that only support the older HTTP signature algorithms. :param private_key_path: A string value specifying the path of the file containing @@ -83,18 +83,19 @@ class HttpSigningConfiguration(object): the private key. :param signed_headers: A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be + The two special signature headers ``(request-target)`` and ``(created)`` SHOULD be included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an + The ``(created)`` header expresses when the signature was created. + The ``(request-target)`` header is a concatenation of the lowercased :method, an ASCII space, and the :path pseudo-headers. When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. + ``(created)``, in the list of HTTP headers. When SignedHeaders contains the 'Digest' value, the client performs the following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. + 1. Calculate a digest of request body, as specified in `RFC3230, + section 4.3.2`_. + 2. Set the ``Digest`` header in the request body. + 3. Include the ``Digest`` header and value in the HTTP signature. :param signing_algorithm: A string value specifying the signature algorithm, when signing HTTP requests. Supported values are: @@ -112,12 +113,16 @@ class HttpSigningConfiguration(object): :param signature_max_validity: The signature max validity, expressed as a datetime.timedelta value. It must be a positive value. """ - def __init__(self, key_id, signing_scheme, private_key_path, - private_key_passphrase=None, - signed_headers=None, - signing_algorithm=None, - hash_algorithm=None, - signature_max_validity=None): + def __init__(self, + key_id: str, + signing_scheme: str, + private_key_path: str, + private_key_passphrase: Union[None, str]=None, + signed_headers: Optional[List[str]]=None, + signing_algorithm: Optional[str]=None, + hash_algorithm: Optional[str]=None, + signature_max_validity: Optional[timedelta]=None, + ) -> None: self.key_id = key_id if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) @@ -161,11 +166,11 @@ class HttpSigningConfiguration(object): if HEADER_AUTHORIZATION in signed_headers: raise Exception("'Authorization' header cannot be included in signed headers") self.signed_headers = signed_headers - self.private_key = None + self.private_key: Optional[Union[ECC.EccKey, RSA.RsaKey]] = None """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. """ - self.host = None + self.host: Optional[str] = None """The host name, optionally followed by a colon and TCP port number. """ self._load_private_key() @@ -203,7 +208,7 @@ class HttpSigningConfiguration(object): def get_public_key(self): """Returns the public key object associated with the private key. """ - pubkey = None + pubkey: Optional[Union[ECC.EccKey, RSA.RsaKey]] = None if isinstance(self.private_key, RSA.RsaKey): pubkey = self.private_key.publickey() elif isinstance(self.private_key, ECC.EccKey): @@ -232,8 +237,11 @@ class HttpSigningConfiguration(object): elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: # Key is in PKCS8 format, which is capable of holding many different # types of private keys, not just EC keys. - (key_binary, pem_header, is_encrypted) = \ - PEM.decode(pem_data, self.private_key_passphrase) + if self.private_key_passphrase is not None: + passphrase = self.private_key_passphrase.encode("utf-8") + else: + passphrase = None + (key_binary, pem_header, is_encrypted) = PEM.decode(pem_data, passphrase) (oid, privkey, params) = \ PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) if oid == '1.2.840.10045.2.1': @@ -273,7 +281,7 @@ class HttpSigningConfiguration(object): if body is None: body = '' else: - body = json.dumps(body) + body = body.to_json() # Build the '(request-target)' HTTP signature parameter. target_host = urlparse(self.host).netloc @@ -314,8 +322,11 @@ class HttpSigningConfiguration(object): request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( digest_prefix, b64_body_digest.decode('ascii')) elif hdr_key == HEADER_HOST.lower(): - value = target_host - request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) + if isinstance(target_host, bytes): + value = target_host.decode('ascii') + else: + value = target_host + request_headers_dict[HEADER_HOST] = value else: value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) if value is None: @@ -336,6 +347,9 @@ class HttpSigningConfiguration(object): The prefix is a string that identifies the cryptographic hash. It is used to generate the 'Digest' header as specified in RFC 3230. """ + + digest: Union[SHA256Hash, SHA512Hash] + if self.hash_algorithm == HASH_SHA512: digest = SHA512.new() prefix = 'SHA-512=' diff --git a/templates/test-requirements.mustache b/templates/test-requirements.mustache index 635b816..8e6d8cb 100644 --- a/templates/test-requirements.mustache +++ b/templates/test-requirements.mustache @@ -1,13 +1,5 @@ -{{#useNose}} -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 -{{/useNose}} -{{^useNose}} +pytest~=7.1.3 pytest-cov>=2.8.1 -{{/useNose}} -{{#hasHttpSignatureMethods}} -pycryptodome>=3.9.0 -{{/hasHttpSignatureMethods}} +pytest-randomly>=3.12.0 +mypy>=1.4.1 +types-python-dateutil>=2.8.19 diff --git a/templates/tornado/rest.mustache b/templates/tornado/rest.mustache index 9e5cc12..f4bfbfb 100644 --- a/templates/tornado/rest.mustache +++ b/templates/tornado/rest.mustache @@ -1,12 +1,12 @@ +# coding: utf-8 + {{>partial_header}} import io import json -import logging import re -# python 2 and python 3 compatibility library -from six.moves.urllib.parse import urlencode +from urllib.parse import urlencode import tornado import tornado.gen from tornado import httpclient @@ -14,34 +14,33 @@ from urllib3.filepost import encode_multipart_formdata from {{packageName}}.exceptions import ApiException, ApiValueError -logger = logging.getLogger(__name__) - +RESTResponseType = httpclient.HTTPResponse class RESTResponse(io.IOBase): - def __init__(self, resp): - self.tornado_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.code self.reason = resp.reason + self.data = None - if resp.body: - self.data = resp.body - else: - self.data = None + def read(self): + if self.data is None: + self.data = self.response.body + return self.data def getheaders(self): """Returns a CIMultiDictProxy of the response headers.""" - return self.tornado_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.tornado_response.headers.get(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=4): - # maxsize is number of requests to host that are allowed in parallel + def __init__(self, configuration) -> None: self.ca_certs = configuration.ssl_ca_cert self.client_key = configuration.key_file @@ -57,29 +56,39 @@ class RESTClientObject(object): self.pool_manager = httpclient.AsyncHTTPClient() @tornado.gen.coroutine - def request(self, method, url, query_params=None, headers=None, body=None, - post_params=None, _preload_content=True, - _request_timeout=None): + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Execute Request :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: this is a non-applicable field for - the AiohttpClient. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -102,16 +111,13 @@ class RESTClientObject(object): post_params = post_params or {} - if query_params: - request.url += '?' + urlencode(query_params) - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: if re.search('json', headers['Content-Type'], re.IGNORECASE): if body: body = json.dumps(body) request.body = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': request.body = urlencode(post_params) elif headers['Content-Type'] == 'multipart/form-data': multipart = encode_multipart_formdata(post_params) @@ -130,93 +136,7 @@ class RESTClientObject(object): r = yield self.pool_manager.fetch(request, raise_error=False) - if _preload_content: - - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) + r = RESTResponse(r) raise tornado.gen.Return(r) - - @tornado.gen.coroutine - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - result = yield self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - result = yield self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - result = yield self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) - - @tornado.gen.coroutine - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - result = yield self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - raise tornado.gen.Return(result) diff --git a/templates/tox.mustache b/templates/tox.mustache index 4c771c4..9d717c3 100644 --- a/templates/tox.mustache +++ b/templates/tox.mustache @@ -6,4 +6,4 @@ deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - {{^useNose}}pytest --cov={{{packageName}}}{{/useNose}}{{#useNose}}nosetests{{/useNose}} + pytest --cov={{{packageName}}} diff --git a/templates/travis.mustache b/templates/travis.mustache index a26c984..53cb57e 100644 --- a/templates/travis.mustache +++ b/templates/travis.mustache @@ -1,18 +1,17 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.6" - "3.7" - "3.8" - "3.9" + - "3.10" + - "3.11" + # uncomment the following if needed + #- "3.11-dev" # 3.11 development branch + #- "nightly" # nightly build # command to install dependencies install: - "pip install -r requirements.txt" - "pip install -r test-requirements.txt" # command to run tests -{{#useNose}} -script: nosetests -{{/useNose}} -{{^useNose}} script: pytest --cov={{{packageName}}} -{{/useNose}} diff --git a/test-requirements.txt b/test-requirements.txt index bb4f22b..8e6d8cb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1 +1,5 @@ +pytest~=7.1.3 pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 +mypy>=1.4.1 +types-python-dateutil>=2.8.19 diff --git a/tests/test_account_api.py b/tests/test_account_api.py index 626550a..c111714 100644 --- a/tests/test_account_api.py +++ b/tests/test_account_api.py @@ -35,8 +35,8 @@ def test_http_code_range(self): try: self.api.account_create(obj) except ApiException as e: - self.assertEqual(e.body.__class__.__name__, response_class) - self.assertEqual(e.body, expected) + self.assertEqual(e.data.__class__.__name__, response_class) + self.assertEqual(e.data, expected) def test_account_create(self): request_class = 'AccountCreateRequest' diff --git a/tests/test_api_app_api.py b/tests/test_api_app_api.py index 46d76f2..58b4ece 100644 --- a/tests/test_api_app_api.py +++ b/tests/test_api_app_api.py @@ -23,7 +23,8 @@ def test_api_app_create(self): self.mock_pool.expect_request( content_type='multipart/form-data', data=request_data, - response=response_data + response=response_data, + status=201, ) obj = m.ApiAppCreateRequest.init(request_data) diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py index 252d2df..626d38d 100644 --- a/tests/test_fixtures.py +++ b/tests/test_fixtures.py @@ -50,17 +50,16 @@ def test_is_valid(self): yanked_files = {} data = {} - openapi_types = class_type.openapi_types - for param, param_value in openapi_types.items(): + for param, param_value in class_type.openapi_types().items(): if param not in fixt_data.keys(): continue data[param] = fixt_data[param] obj = api_client.deserialize( - response=type('obj_dict', (object,), {'data': json.dumps(data)}), - response_type=[class_type], - _check_type=True, + response_text=json.dumps(data), + response_type=class_type, + content_type="application/json", ) for yanked_key, yanked_file in yanked_files.items(): diff --git a/tests/test_model_signature_request_send_request.py b/tests/test_model_signature_request_send_request.py index 82947b4..54d3643 100644 --- a/tests/test_model_signature_request_send_request.py +++ b/tests/test_model_signature_request_send_request.py @@ -59,6 +59,7 @@ def test_is_valid(self): height=16, x=112, y=328, + required=False, ) data = models.SignatureRequestSendRequest( diff --git a/tests/test_signature_request_api.py b/tests/test_signature_request_api.py index 1146f35..d09ca25 100644 --- a/tests/test_signature_request_api.py +++ b/tests/test_signature_request_api.py @@ -39,7 +39,6 @@ def test_init_allows_binary_file(self): "required": True, "signer": "0", "page": 1, - "placeholder": "My placeholder value", } ], "files": [open(get_base_path() + "/../test_fixtures/pdf-sample.pdf", "rb")] @@ -67,7 +66,6 @@ def test_init_allows_binary_file(self): self.assertEqual(data["form_fields_per_document"][0]["required"], obj.form_fields_per_document[0].required) self.assertEqual(data["form_fields_per_document"][0]["signer"], obj.form_fields_per_document[0].signer) self.assertEqual(data["form_fields_per_document"][0]["page"], obj.form_fields_per_document[0].page) - self.assertEqual(data["form_fields_per_document"][0]["placeholder"], obj.form_fields_per_document[0].placeholder) self.assertEqual(data["files"][0], obj.files[0]) @@ -93,21 +91,24 @@ def test_init_allows_jsony_chars_in_strings(self): "files": [open(get_base_path() + "/../test_fixtures/pdf-sample.pdf", "rb")] } + response_class = 'SignatureRequestGetResponse' + response_data = get_fixture_data(response_class)['default'] + obj = m.SignatureRequestSendRequest.init(request_data) self.mock_pool.expect_request( content_type='multipart/form-data', data=request_data, - response={} + response=response_data, ) self.api.signature_request_send(obj) fields = self.mock_pool.get_fields() - title_result = fields[1] - subject_result = fields[2] - message_result = fields[3] + title_result = fields[9] + subject_result = fields[7] + message_result = fields[6] self.assertEqual(title_result[1], title) self.assertEqual(subject_result[1], subject) @@ -254,7 +255,7 @@ def test_signature_request_list_null_query_value_removed(self): self.api.signature_request_list(account_id=account_id) - request_fields = self.mock_pool.get_fields() + request_fields = self.mock_pool.get_query_params() self.assertTrue(not request_fields) account_id = None @@ -267,7 +268,7 @@ def test_signature_request_list_null_query_value_removed(self): self.api.signature_request_list(account_id=account_id, query=query) - request_fields = self.mock_pool.get_fields() + request_fields = self.mock_pool.get_query_params() self.assertTrue(not request_fields) account_id = 'ABC123' @@ -280,11 +281,11 @@ def test_signature_request_list_null_query_value_removed(self): self.api.signature_request_list(account_id=account_id, query=query) - request_fields = self.mock_pool.get_fields() - expected_fields = [ - ('account_id', account_id), - ] - self.assertTrue(expected_fields == request_fields) + request_fields = self.mock_pool.get_query_params() + expected_fields = { + 'account_id': [account_id], + } + self.assertEqual(expected_fields, request_fields) account_id = 'ABC123' query = 'My amazing query' @@ -296,12 +297,12 @@ def test_signature_request_list_null_query_value_removed(self): self.api.signature_request_list(account_id=account_id, query=query) - request_fields = self.mock_pool.get_fields() - expected_fields = [ - ('account_id', account_id), - ('query', query), - ] - self.assertTrue(expected_fields == request_fields) + request_fields = self.mock_pool.get_query_params() + expected_fields = { + 'account_id': [account_id], + 'query': [query], + } + self.assertEqual(expected_fields, request_fields) def test_signature_request_release_hold(self): signature_request_id = 'fa5c8a0b0f492d768749333ad6fcc214c111e967' diff --git a/tests/test_team_api.py b/tests/test_team_api.py index 0701770..f0a8a8c 100644 --- a/tests/test_team_api.py +++ b/tests/test_team_api.py @@ -101,7 +101,8 @@ def test_team_remove_member(self): self.mock_pool.expect_request( content_type='application/json', data=request_data, - response=response_data + response=response_data, + status=201, ) expected = m.TeamGetResponse.init(response_data) obj = m.TeamRemoveMemberRequest.init(request_data) diff --git a/tests/test_utils.py b/tests/test_utils.py index 18e70a2..952c7e4 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,6 +1,8 @@ import os import json import urllib3 +from urllib.parse import urlparse +from urllib.parse import parse_qs def get_base_path(): @@ -23,6 +25,7 @@ def __init__(self, tc): self._expected_request = {} self._expected_response = {} self._request_fields = [] + self._query_params = {} def expect_request(self, content_type, data=None, response=None, status=200): self._expected_request = { @@ -44,6 +47,8 @@ def request(self, *args, **kwargs): if 'fields' in kwargs: self._request_fields = kwargs['fields'] + self._query_params = parse_qs(urlparse(args[1]).query) + return urllib3.HTTPResponse( status=self._expected_response['status'], preload_content=True, @@ -52,3 +57,6 @@ def request(self, *args, **kwargs): def get_fields(self): return self._request_fields + + def get_query_params(self): + return self._query_params