dropbox-sign 1.0.0.pre.beta2301
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +78 -0
- data/LICENSE +21 -0
- data/README.md +333 -0
- data/Rakefile +10 -0
- data/bin/generate-examples.php +269 -0
- data/bin/php +16 -0
- data/bin/replace +11 -0
- data/bin/ruby +16 -0
- data/bin/scan_for +32 -0
- data/composer.json +10 -0
- data/composer.lock +246 -0
- data/docs/AccountApi.md +301 -0
- data/docs/AccountCreateRequest.md +13 -0
- data/docs/AccountCreateResponse.md +12 -0
- data/docs/AccountGetResponse.md +11 -0
- data/docs/AccountResponse.md +19 -0
- data/docs/AccountResponseQuotas.md +14 -0
- data/docs/AccountUpdateRequest.md +12 -0
- data/docs/AccountVerifyRequest.md +10 -0
- data/docs/AccountVerifyResponse.md +11 -0
- data/docs/AccountVerifyResponseAccount.md +10 -0
- data/docs/ApiAppApi.md +402 -0
- data/docs/ApiAppCreateRequest.md +16 -0
- data/docs/ApiAppGetResponse.md +11 -0
- data/docs/ApiAppListResponse.md +12 -0
- data/docs/ApiAppResponse.md +19 -0
- data/docs/ApiAppResponseOAuth.md +13 -0
- data/docs/ApiAppResponseOptions.md +10 -0
- data/docs/ApiAppResponseOwnerAccount.md +11 -0
- data/docs/ApiAppResponseWhiteLabelingOptions.md +23 -0
- data/docs/ApiAppUpdateRequest.md +16 -0
- data/docs/BulkSendJobApi.md +155 -0
- data/docs/BulkSendJobGetResponse.md +13 -0
- data/docs/BulkSendJobGetResponseSignatureRequests.md +33 -0
- data/docs/BulkSendJobListResponse.md +12 -0
- data/docs/BulkSendJobResponse.md +13 -0
- data/docs/BulkSendJobSendResponse.md +11 -0
- data/docs/EmbeddedApi.md +158 -0
- data/docs/EmbeddedEditUrlRequest.md +19 -0
- data/docs/EmbeddedEditUrlResponse.md +11 -0
- data/docs/EmbeddedEditUrlResponseEmbedded.md +11 -0
- data/docs/EmbeddedSignUrlResponse.md +11 -0
- data/docs/EmbeddedSignUrlResponseEmbedded.md +11 -0
- data/docs/ErrorResponse.md +10 -0
- data/docs/ErrorResponseError.md +12 -0
- data/docs/EventCallbackRequest.md +13 -0
- data/docs/EventCallbackRequestEvent.md +13 -0
- data/docs/EventCallbackRequestEventMetadata.md +13 -0
- data/docs/FileResponse.md +11 -0
- data/docs/FileResponseDataUri.md +10 -0
- data/docs/ListInfoResponse.md +13 -0
- data/docs/OAuthApi.md +158 -0
- data/docs/OAuthTokenGenerateRequest.md +14 -0
- data/docs/OAuthTokenRefreshRequest.md +11 -0
- data/docs/OAuthTokenResponse.md +14 -0
- data/docs/ReportApi.md +83 -0
- data/docs/ReportCreateRequest.md +12 -0
- data/docs/ReportCreateResponse.md +11 -0
- data/docs/ReportResponse.md +13 -0
- data/docs/SignatureRequestApi.md +1377 -0
- data/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +22 -0
- data/docs/SignatureRequestBulkSendWithTemplateRequest.md +22 -0
- data/docs/SignatureRequestCreateEmbeddedRequest.md +33 -0
- data/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +24 -0
- data/docs/SignatureRequestGetResponse.md +11 -0
- data/docs/SignatureRequestListResponse.md +12 -0
- data/docs/SignatureRequestRemindRequest.md +11 -0
- data/docs/SignatureRequestResponse.md +32 -0
- data/docs/SignatureRequestResponseAttachment.md +15 -0
- data/docs/SignatureRequestResponseCustomFieldBase.md +17 -0
- data/docs/SignatureRequestResponseCustomFieldCheckbox.md +11 -0
- data/docs/SignatureRequestResponseCustomFieldText.md +11 -0
- data/docs/SignatureRequestResponseCustomFieldTypeEnum.md +9 -0
- data/docs/SignatureRequestResponseDataBase.md +14 -0
- data/docs/SignatureRequestResponseDataTypeEnum.md +9 -0
- data/docs/SignatureRequestResponseDataValueCheckbox.md +11 -0
- data/docs/SignatureRequestResponseDataValueCheckboxMerge.md +11 -0
- data/docs/SignatureRequestResponseDataValueDateSigned.md +11 -0
- data/docs/SignatureRequestResponseDataValueDropdown.md +11 -0
- data/docs/SignatureRequestResponseDataValueInitials.md +11 -0
- data/docs/SignatureRequestResponseDataValueRadio.md +11 -0
- data/docs/SignatureRequestResponseDataValueSignature.md +11 -0
- data/docs/SignatureRequestResponseDataValueText.md +11 -0
- data/docs/SignatureRequestResponseDataValueTextMerge.md +11 -0
- data/docs/SignatureRequestResponseSignatures.md +28 -0
- data/docs/SignatureRequestSendRequest.md +34 -0
- data/docs/SignatureRequestSendWithTemplateRequest.md +25 -0
- data/docs/SignatureRequestUpdateRequest.md +13 -0
- data/docs/SubAttachment.md +13 -0
- data/docs/SubBulkSignerList.md +11 -0
- data/docs/SubBulkSignerListCustomField.md +11 -0
- data/docs/SubCC.md +11 -0
- data/docs/SubCustomField.md +17 -0
- data/docs/SubEditorOptions.md +11 -0
- data/docs/SubFieldOptions.md +10 -0
- data/docs/SubFormFieldGroup.md +12 -0
- data/docs/SubFormFieldRule.md +13 -0
- data/docs/SubFormFieldRuleAction.md +13 -0
- data/docs/SubFormFieldRuleTrigger.md +13 -0
- data/docs/SubFormFieldsPerDocumentBase.md +33 -0
- data/docs/SubFormFieldsPerDocumentCheckbox.md +12 -0
- data/docs/SubFormFieldsPerDocumentCheckboxMerge.md +10 -0
- data/docs/SubFormFieldsPerDocumentDateSigned.md +10 -0
- data/docs/SubFormFieldsPerDocumentDropdown.md +12 -0
- data/docs/SubFormFieldsPerDocumentHyperlink.md +12 -0
- data/docs/SubFormFieldsPerDocumentInitials.md +10 -0
- data/docs/SubFormFieldsPerDocumentRadio.md +12 -0
- data/docs/SubFormFieldsPerDocumentSignature.md +10 -0
- data/docs/SubFormFieldsPerDocumentText.md +17 -0
- data/docs/SubFormFieldsPerDocumentTextMerge.md +10 -0
- data/docs/SubFormFieldsPerDocumentTypeEnum.md +9 -0
- data/docs/SubMergeField.md +11 -0
- data/docs/SubOAuth.md +11 -0
- data/docs/SubOptions.md +10 -0
- data/docs/SubSignatureRequestGroupedSigners.md +12 -0
- data/docs/SubSignatureRequestSigner.md +15 -0
- data/docs/SubSignatureRequestTemplateSigner.md +15 -0
- data/docs/SubSigningOptions.md +16 -0
- data/docs/SubTeamResponse.md +11 -0
- data/docs/SubTemplateRole.md +11 -0
- data/docs/SubUnclaimedDraftSigner.md +12 -0
- data/docs/SubUnclaimedDraftTemplateSigner.md +12 -0
- data/docs/SubWhiteLabelingOptions.md +26 -0
- data/docs/TeamAddMemberRequest.md +12 -0
- data/docs/TeamApi.md +737 -0
- data/docs/TeamCreateRequest.md +10 -0
- data/docs/TeamGetInfoResponse.md +11 -0
- data/docs/TeamGetResponse.md +11 -0
- data/docs/TeamInfoResponse.md +14 -0
- data/docs/TeamInviteResponse.md +15 -0
- data/docs/TeamInvitesResponse.md +11 -0
- data/docs/TeamMemberResponse.md +12 -0
- data/docs/TeamMembersResponse.md +12 -0
- data/docs/TeamParentResponse.md +11 -0
- data/docs/TeamRemoveMemberRequest.md +14 -0
- data/docs/TeamResponse.md +12 -0
- data/docs/TeamSubTeamsResponse.md +12 -0
- data/docs/TeamUpdateRequest.md +10 -0
- data/docs/TemplateAddUserRequest.md +12 -0
- data/docs/TemplateApi.md +782 -0
- data/docs/TemplateCreateEmbeddedDraftRequest.md +34 -0
- data/docs/TemplateCreateEmbeddedDraftResponse.md +11 -0
- data/docs/TemplateCreateEmbeddedDraftResponseTemplate.md +13 -0
- data/docs/TemplateEditResponse.md +10 -0
- data/docs/TemplateGetResponse.md +11 -0
- data/docs/TemplateListResponse.md +12 -0
- data/docs/TemplateRemoveUserRequest.md +11 -0
- data/docs/TemplateResponse.md +24 -0
- data/docs/TemplateResponseAccount.md +15 -0
- data/docs/TemplateResponseAccountQuota.md +13 -0
- data/docs/TemplateResponseCCRole.md +10 -0
- data/docs/TemplateResponseCustomField.md +22 -0
- data/docs/TemplateResponseDocument.md +15 -0
- data/docs/TemplateResponseDocumentCustomField.md +25 -0
- data/docs/TemplateResponseDocumentFieldGroup.md +11 -0
- data/docs/TemplateResponseDocumentFormField.md +23 -0
- data/docs/TemplateResponseDocumentStaticField.md +19 -0
- data/docs/TemplateResponseFieldAvgTextLength.md +11 -0
- data/docs/TemplateResponseNamedFormField.md +23 -0
- data/docs/TemplateResponseSignerRole.md +11 -0
- data/docs/TemplateUpdateFilesRequest.md +15 -0
- data/docs/TemplateUpdateFilesResponse.md +10 -0
- data/docs/TemplateUpdateFilesResponseTemplate.md +11 -0
- data/docs/UnclaimedDraftApi.md +359 -0
- data/docs/UnclaimedDraftCreateEmbeddedRequest.md +45 -0
- data/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md +38 -0
- data/docs/UnclaimedDraftCreateRequest.md +33 -0
- data/docs/UnclaimedDraftCreateResponse.md +11 -0
- data/docs/UnclaimedDraftEditAndResendRequest.md +17 -0
- data/docs/UnclaimedDraftResponse.md +15 -0
- data/docs/WarningResponse.md +11 -0
- data/dropbox-sign.gemspec +38 -0
- data/examples/AccountCreate.rb +21 -0
- data/examples/AccountGet.rb +18 -0
- data/examples/AccountUpdate.rb +21 -0
- data/examples/AccountVerify.rb +21 -0
- data/examples/ApiAppCreate.rb +35 -0
- data/examples/ApiAppDelete.rb +20 -0
- data/examples/ApiAppGet.rb +20 -0
- data/examples/ApiAppList.rb +21 -0
- data/examples/ApiAppUpdate.rb +32 -0
- data/examples/BulkSendJobGet.rb +20 -0
- data/examples/BulkSendJobList.rb +21 -0
- data/examples/EmbeddedEditUrl.rb +24 -0
- data/examples/EmbeddedSignUrl.rb +20 -0
- data/examples/EventCallback.rb +32 -0
- data/examples/OauthTokenGenerate.rb +24 -0
- data/examples/OauthTokenRefresh.rb +21 -0
- data/examples/ReportCreate.rb +23 -0
- data/examples/SignatureRequestBulkCreateEmbeddedWithTemplate.rb +59 -0
- data/examples/SignatureRequestBulkSendWithTemplate.rb +58 -0
- data/examples/SignatureRequestCancel.rb +20 -0
- data/examples/SignatureRequestCreateEmbedded.rb +46 -0
- data/examples/SignatureRequestCreateEmbeddedWithTemplate.rb +39 -0
- data/examples/SignatureRequestFiles.rb +20 -0
- data/examples/SignatureRequestFilesAsDataUri.rb +20 -0
- data/examples/SignatureRequestFilesAsFileUrl.rb +20 -0
- data/examples/SignatureRequestGet.rb +20 -0
- data/examples/SignatureRequestList.rb +21 -0
- data/examples/SignatureRequestReleaseHold.rb +20 -0
- data/examples/SignatureRequestRemind.rb +23 -0
- data/examples/SignatureRequestRemove.rb +20 -0
- data/examples/SignatureRequestSend.rb +56 -0
- data/examples/SignatureRequestSendWithTemplate.rb +50 -0
- data/examples/SignatureRequestUpdate.rb +24 -0
- data/examples/TeamAddMember.rb +21 -0
- data/examples/TeamCreate.rb +21 -0
- data/examples/TeamDelete.rb +18 -0
- data/examples/TeamGet.rb +18 -0
- data/examples/TeamInfo.rb +18 -0
- data/examples/TeamInvites.rb +20 -0
- data/examples/TeamMembers.rb +20 -0
- data/examples/TeamRemoveMember.rb +22 -0
- data/examples/TeamSubTeams.rb +20 -0
- data/examples/TeamUpdate.rb +21 -0
- data/examples/TemplateAddUser.rb +23 -0
- data/examples/TemplateCreateEmbeddedDraft.rb +49 -0
- data/examples/TemplateDelete.rb +20 -0
- data/examples/TemplateFiles.rb +20 -0
- data/examples/TemplateFilesAsDataUri.rb +20 -0
- data/examples/TemplateFilesAsFileUrl.rb +20 -0
- data/examples/TemplateGet.rb +20 -0
- data/examples/TemplateList.rb +20 -0
- data/examples/TemplateRemoveUser.rb +23 -0
- data/examples/TemplateUpdateFiles.rb +23 -0
- data/examples/UnclaimedDraftCreate.rb +56 -0
- data/examples/UnclaimedDraftCreateEmbedded.rb +24 -0
- data/examples/UnclaimedDraftCreateEmbeddedWithTemplate.rb +35 -0
- data/examples/UnclaimedDraftEditAndResend.rb +24 -0
- data/lib/dropbox-sign/api/account_api.rb +446 -0
- data/lib/dropbox-sign/api/api_app_api.rb +504 -0
- data/lib/dropbox-sign/api/bulk_send_job_api.rb +213 -0
- data/lib/dropbox-sign/api/embedded_api.rb +234 -0
- data/lib/dropbox-sign/api/o_auth_api.rb +215 -0
- data/lib/dropbox-sign/api/report_api.rb +134 -0
- data/lib/dropbox-sign/api/signature_request_api.rb +1620 -0
- data/lib/dropbox-sign/api/team_api.rb +1011 -0
- data/lib/dropbox-sign/api/template_api.rb +1037 -0
- data/lib/dropbox-sign/api/unclaimed_draft_api.rb +467 -0
- data/lib/dropbox-sign/api_client.rb +417 -0
- data/lib/dropbox-sign/api_error.rb +60 -0
- data/lib/dropbox-sign/configuration.rb +303 -0
- data/lib/dropbox-sign/event_callback_helper.rb +54 -0
- data/lib/dropbox-sign/models/account_create_request.rb +285 -0
- data/lib/dropbox-sign/models/account_create_response.rb +270 -0
- data/lib/dropbox-sign/models/account_get_response.rb +261 -0
- data/lib/dropbox-sign/models/account_response.rb +343 -0
- data/lib/dropbox-sign/models/account_response_quotas.rb +296 -0
- data/lib/dropbox-sign/models/account_update_request.rb +271 -0
- data/lib/dropbox-sign/models/account_verify_request.rb +255 -0
- data/lib/dropbox-sign/models/account_verify_response.rb +261 -0
- data/lib/dropbox-sign/models/account_verify_response_account.rb +250 -0
- data/lib/dropbox-sign/models/api_app_create_request.rb +347 -0
- data/lib/dropbox-sign/models/api_app_get_response.rb +261 -0
- data/lib/dropbox-sign/models/api_app_list_response.rb +273 -0
- data/lib/dropbox-sign/models/api_app_response.rb +343 -0
- data/lib/dropbox-sign/models/api_app_response_o_auth.rb +283 -0
- data/lib/dropbox-sign/models/api_app_response_options.rb +251 -0
- data/lib/dropbox-sign/models/api_app_response_owner_account.rb +261 -0
- data/lib/dropbox-sign/models/api_app_response_white_labeling_options.rb +367 -0
- data/lib/dropbox-sign/models/api_app_update_request.rb +324 -0
- data/lib/dropbox-sign/models/bulk_send_job_get_response.rb +282 -0
- data/lib/dropbox-sign/models/bulk_send_job_get_response_signature_requests.rb +503 -0
- data/lib/dropbox-sign/models/bulk_send_job_list_response.rb +273 -0
- data/lib/dropbox-sign/models/bulk_send_job_response.rb +282 -0
- data/lib/dropbox-sign/models/bulk_send_job_send_response.rb +261 -0
- data/lib/dropbox-sign/models/embedded_edit_url_request.rb +357 -0
- data/lib/dropbox-sign/models/embedded_edit_url_response.rb +261 -0
- data/lib/dropbox-sign/models/embedded_edit_url_response_embedded.rb +261 -0
- data/lib/dropbox-sign/models/embedded_sign_url_response.rb +261 -0
- data/lib/dropbox-sign/models/embedded_sign_url_response_embedded.rb +261 -0
- data/lib/dropbox-sign/models/error_response.rb +254 -0
- data/lib/dropbox-sign/models/error_response_error.rb +281 -0
- data/lib/dropbox-sign/models/event_callback_request.rb +281 -0
- data/lib/dropbox-sign/models/event_callback_request_event.rb +334 -0
- data/lib/dropbox-sign/models/event_callback_request_event_metadata.rb +285 -0
- data/lib/dropbox-sign/models/file_response.rb +260 -0
- data/lib/dropbox-sign/models/file_response_data_uri.rb +250 -0
- data/lib/dropbox-sign/models/list_info_response.rb +282 -0
- data/lib/dropbox-sign/models/o_auth_token_generate_request.rb +317 -0
- data/lib/dropbox-sign/models/o_auth_token_refresh_request.rb +272 -0
- data/lib/dropbox-sign/models/o_auth_token_response.rb +287 -0
- data/lib/dropbox-sign/models/report_create_request.rb +319 -0
- data/lib/dropbox-sign/models/report_create_response.rb +261 -0
- data/lib/dropbox-sign/models/report_response.rb +305 -0
- data/lib/dropbox-sign/models/signature_request_bulk_create_embedded_with_template_request.rb +445 -0
- data/lib/dropbox-sign/models/signature_request_bulk_send_with_template_request.rb +440 -0
- data/lib/dropbox-sign/models/signature_request_create_embedded_request.rb +569 -0
- data/lib/dropbox-sign/models/signature_request_create_embedded_with_template_request.rb +475 -0
- data/lib/dropbox-sign/models/signature_request_get_response.rb +261 -0
- data/lib/dropbox-sign/models/signature_request_list_response.rb +273 -0
- data/lib/dropbox-sign/models/signature_request_remind_request.rb +265 -0
- data/lib/dropbox-sign/models/signature_request_response.rb +494 -0
- data/lib/dropbox-sign/models/signature_request_response_attachment.rb +323 -0
- data/lib/dropbox-sign/models/signature_request_response_custom_field_base.rb +316 -0
- data/lib/dropbox-sign/models/signature_request_response_custom_field_checkbox.rb +272 -0
- data/lib/dropbox-sign/models/signature_request_response_custom_field_text.rb +272 -0
- data/lib/dropbox-sign/models/signature_request_response_custom_field_type_enum.rb +40 -0
- data/lib/dropbox-sign/models/signature_request_response_data_base.rb +326 -0
- data/lib/dropbox-sign/models/signature_request_response_data_type_enum.rb +47 -0
- data/lib/dropbox-sign/models/signature_request_response_data_value_checkbox.rb +266 -0
- data/lib/dropbox-sign/models/signature_request_response_data_value_checkbox_merge.rb +266 -0
- data/lib/dropbox-sign/models/signature_request_response_data_value_date_signed.rb +266 -0
- data/lib/dropbox-sign/models/signature_request_response_data_value_dropdown.rb +266 -0
- data/lib/dropbox-sign/models/signature_request_response_data_value_initials.rb +266 -0
- data/lib/dropbox-sign/models/signature_request_response_data_value_radio.rb +266 -0
- data/lib/dropbox-sign/models/signature_request_response_data_value_signature.rb +266 -0
- data/lib/dropbox-sign/models/signature_request_response_data_value_text.rb +266 -0
- data/lib/dropbox-sign/models/signature_request_response_data_value_text_merge.rb +266 -0
- data/lib/dropbox-sign/models/signature_request_response_signatures.rb +446 -0
- data/lib/dropbox-sign/models/signature_request_send_request.rb +574 -0
- data/lib/dropbox-sign/models/signature_request_send_with_template_request.rb +480 -0
- data/lib/dropbox-sign/models/signature_request_update_request.rb +286 -0
- data/lib/dropbox-sign/models/sub_attachment.rb +292 -0
- data/lib/dropbox-sign/models/sub_bulk_signer_list.rb +264 -0
- data/lib/dropbox-sign/models/sub_bulk_signer_list_custom_field.rb +270 -0
- data/lib/dropbox-sign/models/sub_cc.rb +270 -0
- data/lib/dropbox-sign/models/sub_custom_field.rb +288 -0
- data/lib/dropbox-sign/models/sub_editor_options.rb +265 -0
- data/lib/dropbox-sign/models/sub_field_options.rb +290 -0
- data/lib/dropbox-sign/models/sub_form_field_group.rb +285 -0
- data/lib/dropbox-sign/models/sub_form_field_rule.rb +353 -0
- data/lib/dropbox-sign/models/sub_form_field_rule_action.rb +323 -0
- data/lib/dropbox-sign/models/sub_form_field_rule_trigger.rb +326 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_base.rb +435 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_checkbox.rb +287 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_checkbox_merge.rb +262 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_date_signed.rb +262 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_dropdown.rb +308 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_hyperlink.rb +292 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_initials.rb +262 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_radio.rb +292 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_signature.rb +262 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_text.rb +364 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_text_merge.rb +262 -0
- data/lib/dropbox-sign/models/sub_form_fields_per_document_type_enum.rb +48 -0
- data/lib/dropbox-sign/models/sub_merge_field.rb +304 -0
- data/lib/dropbox-sign/models/sub_o_auth.rb +285 -0
- data/lib/dropbox-sign/models/sub_options.rb +253 -0
- data/lib/dropbox-sign/models/sub_signature_request_grouped_signers.rb +283 -0
- data/lib/dropbox-sign/models/sub_signature_request_signer.rb +369 -0
- data/lib/dropbox-sign/models/sub_signature_request_template_signer.rb +373 -0
- data/lib/dropbox-sign/models/sub_signing_options.rb +338 -0
- data/lib/dropbox-sign/models/sub_team_response.rb +260 -0
- data/lib/dropbox-sign/models/sub_template_role.rb +261 -0
- data/lib/dropbox-sign/models/sub_unclaimed_draft_signer.rb +281 -0
- data/lib/dropbox-sign/models/sub_unclaimed_draft_template_signer.rb +285 -0
- data/lib/dropbox-sign/models/sub_white_labeling_options.rb +439 -0
- data/lib/dropbox-sign/models/team_add_member_request.rb +304 -0
- data/lib/dropbox-sign/models/team_create_request.rb +252 -0
- data/lib/dropbox-sign/models/team_get_info_response.rb +261 -0
- data/lib/dropbox-sign/models/team_get_response.rb +261 -0
- data/lib/dropbox-sign/models/team_info_response.rb +290 -0
- data/lib/dropbox-sign/models/team_invite_response.rb +300 -0
- data/lib/dropbox-sign/models/team_invites_response.rb +263 -0
- data/lib/dropbox-sign/models/team_member_response.rb +270 -0
- data/lib/dropbox-sign/models/team_members_response.rb +272 -0
- data/lib/dropbox-sign/models/team_parent_response.rb +261 -0
- data/lib/dropbox-sign/models/team_remove_member_request.rb +324 -0
- data/lib/dropbox-sign/models/team_response.rb +274 -0
- data/lib/dropbox-sign/models/team_sub_teams_response.rb +272 -0
- data/lib/dropbox-sign/models/team_update_request.rb +250 -0
- data/lib/dropbox-sign/models/template_add_user_request.rb +272 -0
- data/lib/dropbox-sign/models/template_create_embedded_draft_request.rb +567 -0
- data/lib/dropbox-sign/models/template_create_embedded_draft_response.rb +261 -0
- data/lib/dropbox-sign/models/template_create_embedded_draft_response_template.rb +283 -0
- data/lib/dropbox-sign/models/template_edit_response.rb +250 -0
- data/lib/dropbox-sign/models/template_get_response.rb +261 -0
- data/lib/dropbox-sign/models/template_list_response.rb +273 -0
- data/lib/dropbox-sign/models/template_remove_user_request.rb +260 -0
- data/lib/dropbox-sign/models/template_response.rb +410 -0
- data/lib/dropbox-sign/models/template_response_account.rb +299 -0
- data/lib/dropbox-sign/models/template_response_account_quota.rb +281 -0
- data/lib/dropbox-sign/models/template_response_cc_role.rb +250 -0
- data/lib/dropbox-sign/models/template_response_custom_field.rb +407 -0
- data/lib/dropbox-sign/models/template_response_document.rb +309 -0
- data/lib/dropbox-sign/models/template_response_document_custom_field.rb +438 -0
- data/lib/dropbox-sign/models/template_response_document_field_group.rb +260 -0
- data/lib/dropbox-sign/models/template_response_document_form_field.rb +417 -0
- data/lib/dropbox-sign/models/template_response_document_static_field.rb +341 -0
- data/lib/dropbox-sign/models/template_response_field_avg_text_length.rb +261 -0
- data/lib/dropbox-sign/models/template_response_named_form_field.rb +383 -0
- data/lib/dropbox-sign/models/template_response_signer_role.rb +260 -0
- data/lib/dropbox-sign/models/template_update_files_request.rb +336 -0
- data/lib/dropbox-sign/models/template_update_files_response.rb +249 -0
- data/lib/dropbox-sign/models/template_update_files_response_template.rb +263 -0
- data/lib/dropbox-sign/models/unclaimed_draft_create_embedded_request.rb +728 -0
- data/lib/dropbox-sign/models/unclaimed_draft_create_embedded_with_template_request.rb +631 -0
- data/lib/dropbox-sign/models/unclaimed_draft_create_request.rb +586 -0
- data/lib/dropbox-sign/models/unclaimed_draft_create_response.rb +261 -0
- data/lib/dropbox-sign/models/unclaimed_draft_edit_and_resend_request.rb +328 -0
- data/lib/dropbox-sign/models/unclaimed_draft_response.rb +305 -0
- data/lib/dropbox-sign/models/warning_response.rb +271 -0
- data/lib/dropbox-sign/version.rb +18 -0
- data/lib/dropbox-sign.rb +204 -0
- data/openapi-config.yaml +21 -0
- data/openapi-sdk.yaml +11080 -0
- data/run-build +53 -0
- data/spec/api/account_api_spec.rb +107 -0
- data/spec/api/api_app_api_spec.rb +95 -0
- data/spec/api/bulk_send_job_api_spec.rb +52 -0
- data/spec/api/embedded_api_spec.rb +55 -0
- data/spec/api/oauth_api_spec.rb +55 -0
- data/spec/api/report_api_spec.rb +38 -0
- data/spec/api/signature_request_api_spec.rb +263 -0
- data/spec/api/team_api_spec.rb +105 -0
- data/spec/api/template_api_spec.rb +147 -0
- data/spec/api/unclaimed_draft_api_spec.rb +95 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/event_callback_helper_spec.rb +22 -0
- data/spec/fixtures_spec.rb +59 -0
- data/spec/models/sub_form_fields_per_document_base_spec.rb +24 -0
- data/spec/spec_helper.rb +111 -0
- data/spec/test_utils.rb +19 -0
- data/templates/Gemfile.mustache +10 -0
- data/templates/README.mustache +133 -0
- data/templates/Rakefile.mustache +10 -0
- data/templates/api.mustache +283 -0
- data/templates/api_client.mustache +291 -0
- data/templates/api_client_faraday_partial.mustache +136 -0
- data/templates/api_client_spec.mustache +220 -0
- data/templates/api_client_typhoeus_partial.mustache +153 -0
- data/templates/api_doc.mustache +77 -0
- data/templates/api_error.mustache +52 -0
- data/templates/api_info.mustache +12 -0
- data/templates/api_test.mustache +47 -0
- data/templates/base_object.mustache +132 -0
- data/templates/configuration.mustache +372 -0
- data/templates/configuration_spec.mustache +34 -0
- data/templates/configuration_tls_faraday_partial.mustache +29 -0
- data/templates/configuration_tls_typhoeus_partial.mustache +34 -0
- data/templates/event_callback_helper.mustache +46 -0
- data/templates/gem.mustache +55 -0
- data/templates/gemspec.mustache +35 -0
- data/templates/git_push.sh.mustache +57 -0
- data/templates/gitignore.mustache +41 -0
- data/templates/model.mustache +29 -0
- data/templates/model_doc.mustache +12 -0
- data/templates/model_test.mustache +77 -0
- data/templates/partial_model_enum_class.mustache +20 -0
- data/templates/partial_model_generic.mustache +414 -0
- data/templates/partial_model_generic_doc.mustache +10 -0
- data/templates/partial_oneof_module.mustache +137 -0
- data/templates/partial_oneof_module_doc.mustache +92 -0
- data/templates/rspec.mustache +2 -0
- data/templates/rubocop.mustache +148 -0
- data/templates/spec_helper.mustache +103 -0
- data/templates/travis.mustache +14 -0
- data/templates/version.mustache +10 -0
- data/test_fixtures/AccountCreateRequest.json +7 -0
- data/test_fixtures/AccountCreateResponse.json +15 -0
- data/test_fixtures/AccountGetResponse.json +14 -0
- data/test_fixtures/AccountUpdateRequest.json +5 -0
- data/test_fixtures/AccountVerifyRequest.json +5 -0
- data/test_fixtures/AccountVerifyResponse.json +7 -0
- data/test_fixtures/ApiAppCreateRequest.json +35 -0
- data/test_fixtures/ApiAppGetResponse.json +27 -0
- data/test_fixtures/ApiAppListResponse.json +42 -0
- data/test_fixtures/ApiAppUpdateRequest.json +35 -0
- data/test_fixtures/BulkSendJobGetResponse.json +67 -0
- data/test_fixtures/BulkSendJobListResponse.json +24 -0
- data/test_fixtures/BulkSendJobSendResponse.json +10 -0
- data/test_fixtures/EmbeddedEditUrlRequest.json +28 -0
- data/test_fixtures/EmbeddedEditUrlResponse.json +8 -0
- data/test_fixtures/EmbeddedSignUrlResponse.json +8 -0
- data/test_fixtures/ErrorResponse.json +9 -0
- data/test_fixtures/EventCallbackHelper.json +50 -0
- data/test_fixtures/FileResponse.json +6 -0
- data/test_fixtures/OAuthTokenGenerateRequest.json +9 -0
- data/test_fixtures/OAuthTokenRefreshRequest.json +6 -0
- data/test_fixtures/OAuthTokenResponse.json +15 -0
- data/test_fixtures/ReportCreateRequest.json +10 -0
- data/test_fixtures/ReportCreateResponse.json +13 -0
- data/test_fixtures/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.json +67 -0
- data/test_fixtures/SignatureRequestBulkSendWithTemplateRequest.json +66 -0
- data/test_fixtures/SignatureRequestCreateEmbeddedRequest.json +252 -0
- data/test_fixtures/SignatureRequestCreateEmbeddedWithTemplateRequest.json +60 -0
- data/test_fixtures/SignatureRequestGetResponse.json +146 -0
- data/test_fixtures/SignatureRequestListResponse.json +102 -0
- data/test_fixtures/SignatureRequestRemindRequest.json +5 -0
- data/test_fixtures/SignatureRequestSendRequest.json +463 -0
- data/test_fixtures/SignatureRequestSendWithTemplateRequest.json +48 -0
- data/test_fixtures/SignatureRequestUpdateRequest.json +7 -0
- data/test_fixtures/SubFormFieldsPerDocument.json +107 -0
- data/test_fixtures/TeamAddMemberRequest.json +6 -0
- data/test_fixtures/TeamCreateRequest.json +5 -0
- data/test_fixtures/TeamGetResponse.json +34 -0
- data/test_fixtures/TeamRemoveMemberRequest.json +7 -0
- data/test_fixtures/TeamUpdateRequest.json +5 -0
- data/test_fixtures/TemplateAddUserRequest.json +7 -0
- data/test_fixtures/TemplateCreateEmbeddedDraftRequest.json +118 -0
- data/test_fixtures/TemplateCreateEmbeddedDraftResponse.json +9 -0
- data/test_fixtures/TemplateGetResponse.json +102 -0
- data/test_fixtures/TemplateListResponse.json +143 -0
- data/test_fixtures/TemplateRemoveUserRequest.json +6 -0
- data/test_fixtures/TemplateUpdateFilesRequest.json +11 -0
- data/test_fixtures/TemplateUpdateFilesResponse.json +7 -0
- data/test_fixtures/UnclaimedDraftCreateEmbeddedRequest.json +134 -0
- data/test_fixtures/UnclaimedDraftCreateEmbeddedWithTemplateRequest.json +67 -0
- data/test_fixtures/UnclaimedDraftCreateRequest.json +119 -0
- data/test_fixtures/UnclaimedDraftCreateResponse.json +9 -0
- data/test_fixtures/UnclaimedDraftEditAndResendRequest.json +15 -0
- data/test_fixtures/bulk-send-sample.csv +3 -0
- data/test_fixtures/pdf-sample-2.pdf +0 -0
- data/test_fixtures/pdf-sample.pdf +0 -0
- data/vendor/autoload.php +7 -0
- data/vendor/bin/yaml-lint +117 -0
- data/vendor/composer/ClassLoader.php +572 -0
- data/vendor/composer/InstalledVersions.php +350 -0
- data/vendor/composer/LICENSE +21 -0
- data/vendor/composer/autoload_classmap.php +10 -0
- data/vendor/composer/autoload_files.php +11 -0
- data/vendor/composer/autoload_namespaces.php +9 -0
- data/vendor/composer/autoload_psr4.php +11 -0
- data/vendor/composer/autoload_real.php +80 -0
- data/vendor/composer/autoload_static.php +46 -0
- data/vendor/composer/installed.json +239 -0
- data/vendor/composer/installed.php +50 -0
- data/vendor/composer/platform_check.php +26 -0
- data/vendor/symfony/deprecation-contracts/.gitignore +3 -0
- data/vendor/symfony/deprecation-contracts/CHANGELOG.md +5 -0
- data/vendor/symfony/deprecation-contracts/LICENSE +19 -0
- data/vendor/symfony/deprecation-contracts/README.md +26 -0
- data/vendor/symfony/deprecation-contracts/composer.json +35 -0
- data/vendor/symfony/deprecation-contracts/function.php +27 -0
- data/vendor/symfony/polyfill-ctype/Ctype.php +232 -0
- data/vendor/symfony/polyfill-ctype/LICENSE +19 -0
- data/vendor/symfony/polyfill-ctype/README.md +12 -0
- data/vendor/symfony/polyfill-ctype/bootstrap.php +50 -0
- data/vendor/symfony/polyfill-ctype/bootstrap80.php +46 -0
- data/vendor/symfony/polyfill-ctype/composer.json +41 -0
- data/vendor/symfony/yaml/CHANGELOG.md +237 -0
- data/vendor/symfony/yaml/Command/LintCommand.php +289 -0
- data/vendor/symfony/yaml/Dumper.php +140 -0
- data/vendor/symfony/yaml/Escaper.php +95 -0
- data/vendor/symfony/yaml/Exception/DumpException.php +21 -0
- data/vendor/symfony/yaml/Exception/ExceptionInterface.php +21 -0
- data/vendor/symfony/yaml/Exception/ParseException.php +132 -0
- data/vendor/symfony/yaml/Exception/RuntimeException.php +21 -0
- data/vendor/symfony/yaml/Inline.php +812 -0
- data/vendor/symfony/yaml/LICENSE +19 -0
- data/vendor/symfony/yaml/Parser.php +1305 -0
- data/vendor/symfony/yaml/README.md +13 -0
- data/vendor/symfony/yaml/Resources/bin/yaml-lint +45 -0
- data/vendor/symfony/yaml/Tag/TaggedValue.php +38 -0
- data/vendor/symfony/yaml/Unescaper.php +132 -0
- data/vendor/symfony/yaml/Yaml.php +100 -0
- data/vendor/symfony/yaml/composer.json +42 -0
- metadata +650 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
=begin
|
2
|
+
{{> api_info}}
|
3
|
+
=end
|
4
|
+
|
5
|
+
require 'spec_helper'
|
6
|
+
require 'json'
|
7
|
+
|
8
|
+
# Unit tests for {{moduleName}}::{{classname}}
|
9
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
10
|
+
# Please update as you see appropriate
|
11
|
+
{{#operations}}describe '{{classname}}' do
|
12
|
+
before do
|
13
|
+
# run before each test
|
14
|
+
@api_instance = {{moduleName}}::{{classname}}.new
|
15
|
+
end
|
16
|
+
|
17
|
+
after do
|
18
|
+
# run after each test
|
19
|
+
end
|
20
|
+
|
21
|
+
describe 'test an instance of {{classname}}' do
|
22
|
+
it 'should create an instance of {{classname}}' do
|
23
|
+
expect(@api_instance).to be_instance_of({{moduleName}}::{{classname}})
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
{{#operation}}
|
28
|
+
# unit tests for {{operationId}}
|
29
|
+
{{#summary}}
|
30
|
+
# {{.}}
|
31
|
+
{{/summary}}
|
32
|
+
{{#notes}}
|
33
|
+
# {{.}}
|
34
|
+
{{/notes}}
|
35
|
+
{{#allParams}}{{#required}} # @param {{paramName}} {{description}}
|
36
|
+
{{/required}}{{/allParams}} # @param [Hash] opts the optional parameters
|
37
|
+
{{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}
|
38
|
+
{{/required}}{{/allParams}} # @return [{{{returnType}}}{{^returnType}}nil{{/returnType}}]
|
39
|
+
describe '{{operationId}} test' do
|
40
|
+
it 'should work' do
|
41
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
{{/operation}}
|
46
|
+
end
|
47
|
+
{{/operations}}
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# Builds the object from hash
|
2
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
3
|
+
# @return [Object] Returns the model itself
|
4
|
+
def self.build_from_hash(attributes)
|
5
|
+
{{#discriminator}}
|
6
|
+
if !attributes[self.openapi_discriminator_name].nil?
|
7
|
+
klass = self.discriminator_class_name(attributes[self.openapi_discriminator_name])
|
8
|
+
if klass != new.class.to_s
|
9
|
+
obj = Object.const_get(klass).new.build_from_hash(attributes)
|
10
|
+
return obj
|
11
|
+
end
|
12
|
+
end
|
13
|
+
{{/discriminator}}
|
14
|
+
new.build_from_hash(attributes)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Builds the object from hash
|
18
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
19
|
+
# @return [Object] Returns the model itself
|
20
|
+
def build_from_hash(attributes)
|
21
|
+
return nil unless attributes.is_a?(Hash)
|
22
|
+
{{#parent}}
|
23
|
+
super(attributes)
|
24
|
+
{{/parent}}
|
25
|
+
attribute_map = self.class.merged_attributes
|
26
|
+
|
27
|
+
self.class.merged_types.each_pair do |key, type|
|
28
|
+
if type =~ /\AArray<(.*)>/i
|
29
|
+
# check to ensure the input is an array given that the attribute
|
30
|
+
# is documented as an array but the input is not
|
31
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
32
|
+
self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) })
|
33
|
+
end
|
34
|
+
elsif !attributes[attribute_map[key]].nil?
|
35
|
+
self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]]))
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
self
|
40
|
+
end
|
41
|
+
|
42
|
+
# Deserializes the data based on type
|
43
|
+
# @param string type Data type
|
44
|
+
# @param string value Value to be deserialized
|
45
|
+
# @return [Object] Deserialized data
|
46
|
+
def _deserialize(type, value)
|
47
|
+
case type.to_sym
|
48
|
+
when :Time
|
49
|
+
Time.parse(value)
|
50
|
+
when :Date
|
51
|
+
Date.parse(value)
|
52
|
+
when :String
|
53
|
+
value.to_s
|
54
|
+
when :Integer
|
55
|
+
value.to_i
|
56
|
+
when :Float
|
57
|
+
value.to_f
|
58
|
+
when :Boolean
|
59
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
60
|
+
true
|
61
|
+
else
|
62
|
+
false
|
63
|
+
end
|
64
|
+
when :File
|
65
|
+
value
|
66
|
+
when :Object
|
67
|
+
# generic object (usually a Hash), return directly
|
68
|
+
value
|
69
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
70
|
+
inner_type = Regexp.last_match[:inner_type]
|
71
|
+
value.map { |v| _deserialize(inner_type, v) }
|
72
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
73
|
+
k_type = Regexp.last_match[:k_type]
|
74
|
+
v_type = Regexp.last_match[:v_type]
|
75
|
+
{}.tap do |hash|
|
76
|
+
value.each do |k, v|
|
77
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
else # model
|
81
|
+
# models (e.g. Pet)
|
82
|
+
klass = {{moduleName}}.const_get(type)
|
83
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Returns the string representation of the object
|
88
|
+
# @return [String] String presentation of the object
|
89
|
+
def to_s
|
90
|
+
to_hash.to_s
|
91
|
+
end
|
92
|
+
|
93
|
+
# to_body is an alias to to_hash (backward compatibility)
|
94
|
+
# @return [Hash] Returns the object in the form of hash
|
95
|
+
def to_body
|
96
|
+
to_hash
|
97
|
+
end
|
98
|
+
|
99
|
+
# Returns the object in the form of hash
|
100
|
+
# @return [Hash] Returns the object in the form of hash
|
101
|
+
def to_hash(include_nil = true)
|
102
|
+
hash = {{^parent}}{}{{/parent}}{{#parent}}super{{/parent}}
|
103
|
+
self.class.merged_attributes.each_pair do |attr, param|
|
104
|
+
value = self.send(attr)
|
105
|
+
if value.nil?
|
106
|
+
next unless include_nil
|
107
|
+
is_nullable = self.class.merged_nullable.include?(attr)
|
108
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
109
|
+
end
|
110
|
+
|
111
|
+
hash[param] = _to_hash(value, include_nil)
|
112
|
+
end
|
113
|
+
hash
|
114
|
+
end
|
115
|
+
|
116
|
+
# Outputs non-array value in the form of hash
|
117
|
+
# For object, use to_hash. Otherwise, just return the value
|
118
|
+
# @param [Object] value Any valid value
|
119
|
+
# @return [Hash] Returns the value in the form of hash
|
120
|
+
def _to_hash(value, include_nil = true)
|
121
|
+
if value.is_a?(Array)
|
122
|
+
value.compact.map { |v| _to_hash(v, include_nil) }
|
123
|
+
elsif value.is_a?(Hash)
|
124
|
+
{}.tap do |hash|
|
125
|
+
value.each { |k, v| hash[k] = _to_hash(v, include_nil) }
|
126
|
+
end
|
127
|
+
elsif value.respond_to? :to_hash
|
128
|
+
value.to_hash(include_nil)
|
129
|
+
else
|
130
|
+
value
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,372 @@
|
|
1
|
+
=begin
|
2
|
+
{{> api_info}}
|
3
|
+
=end
|
4
|
+
|
5
|
+
module Dropbox
|
6
|
+
end
|
7
|
+
|
8
|
+
module {{moduleName}}
|
9
|
+
class Configuration
|
10
|
+
# Defines url scheme
|
11
|
+
attr_accessor :scheme
|
12
|
+
|
13
|
+
# Defines url host
|
14
|
+
attr_accessor :host
|
15
|
+
|
16
|
+
# Defines url base path
|
17
|
+
attr_accessor :base_path
|
18
|
+
|
19
|
+
# Define server configuration index
|
20
|
+
attr_accessor :server_index
|
21
|
+
|
22
|
+
# Define server operation configuration index
|
23
|
+
attr_accessor :server_operation_index
|
24
|
+
|
25
|
+
# Default server variables
|
26
|
+
attr_accessor :server_variables
|
27
|
+
|
28
|
+
# Default server operation variables
|
29
|
+
attr_accessor :server_operation_variables
|
30
|
+
|
31
|
+
# Defines API keys used with API Key authentications.
|
32
|
+
#
|
33
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
34
|
+
#
|
35
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
36
|
+
# config.api_key['api_key'] = 'xxx'
|
37
|
+
attr_accessor :api_key
|
38
|
+
|
39
|
+
# Defines API key prefixes used with API Key authentications.
|
40
|
+
#
|
41
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
42
|
+
#
|
43
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
44
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
45
|
+
attr_accessor :api_key_prefix
|
46
|
+
|
47
|
+
# Defines the username used with HTTP basic authentication.
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
attr_accessor :username
|
51
|
+
|
52
|
+
# Defines the password used with HTTP basic authentication.
|
53
|
+
#
|
54
|
+
# @return [String]
|
55
|
+
attr_accessor :password
|
56
|
+
|
57
|
+
# Defines the access token (Bearer) used with OAuth2.
|
58
|
+
attr_accessor :access_token
|
59
|
+
|
60
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
61
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
62
|
+
# Default to false.
|
63
|
+
#
|
64
|
+
# @return [true, false]
|
65
|
+
attr_accessor :debugging
|
66
|
+
|
67
|
+
# Defines the logger used for debugging.
|
68
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
69
|
+
#
|
70
|
+
# @return [#debug]
|
71
|
+
attr_accessor :logger
|
72
|
+
|
73
|
+
# Defines the temporary folder to store downloaded files
|
74
|
+
# (for API endpoints that have file response).
|
75
|
+
# Default to use `Tempfile`.
|
76
|
+
#
|
77
|
+
# @return [String]
|
78
|
+
attr_accessor :temp_folder_path
|
79
|
+
|
80
|
+
# The time limit for HTTP request in seconds.
|
81
|
+
# Default to 0 (never times out).
|
82
|
+
attr_accessor :timeout
|
83
|
+
|
84
|
+
# Set this to false to skip client side validation in the operation.
|
85
|
+
# Default to true.
|
86
|
+
# @return [true, false]
|
87
|
+
attr_accessor :client_side_validation
|
88
|
+
|
89
|
+
{{^isFaraday}}
|
90
|
+
{{> configuration_tls_typhoeus_partial}}
|
91
|
+
{{/isFaraday}}
|
92
|
+
{{#isFaraday}}
|
93
|
+
{{> configuration_tls_faraday_partial}}
|
94
|
+
{{/isFaraday}}
|
95
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
96
|
+
# Default to nil.
|
97
|
+
#
|
98
|
+
# @see The params_encoding option of Ethon. Related source code:
|
99
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
100
|
+
attr_accessor :params_encoding
|
101
|
+
|
102
|
+
attr_accessor :inject_format
|
103
|
+
|
104
|
+
attr_accessor :force_ending_format
|
105
|
+
|
106
|
+
def initialize
|
107
|
+
@scheme = '{{scheme}}'
|
108
|
+
@host = '{{host}}{{#port}}:{{{.}}}{{/port}}'
|
109
|
+
@base_path = '{{contextPath}}'
|
110
|
+
@server_index = 0
|
111
|
+
@server_operation_index = {}
|
112
|
+
@server_variables = {}
|
113
|
+
@server_operation_variables = {}
|
114
|
+
@api_key = {}
|
115
|
+
@api_key_prefix = {}
|
116
|
+
@client_side_validation = true
|
117
|
+
{{#isFaraday}}
|
118
|
+
@ssl_verify = true
|
119
|
+
@ssl_verify_mode = nil
|
120
|
+
@ssl_ca_file = nil
|
121
|
+
@ssl_client_cert = nil
|
122
|
+
@ssl_client_key = nil
|
123
|
+
@middlewares = []
|
124
|
+
@request_middlewares = []
|
125
|
+
@response_middlewares = []
|
126
|
+
@timeout = 60
|
127
|
+
{{/isFaraday}}
|
128
|
+
{{^isFaraday}}
|
129
|
+
@verify_ssl = true
|
130
|
+
@verify_ssl_host = true
|
131
|
+
@params_encoding = nil
|
132
|
+
@cert_file = nil
|
133
|
+
@key_file = nil
|
134
|
+
@timeout = 0
|
135
|
+
{{/isFaraday}}
|
136
|
+
@debugging = false
|
137
|
+
@inject_format = false
|
138
|
+
@force_ending_format = false
|
139
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
140
|
+
|
141
|
+
yield(self) if block_given?
|
142
|
+
end
|
143
|
+
|
144
|
+
# The default Configuration object.
|
145
|
+
def self.default
|
146
|
+
@@default ||= Configuration.new
|
147
|
+
end
|
148
|
+
|
149
|
+
def configure
|
150
|
+
yield(self) if block_given?
|
151
|
+
end
|
152
|
+
|
153
|
+
def scheme=(scheme)
|
154
|
+
# remove :// from scheme
|
155
|
+
@scheme = scheme.sub(/:\/\//, '')
|
156
|
+
end
|
157
|
+
|
158
|
+
def host=(host)
|
159
|
+
# remove http(s):// and anything after a slash
|
160
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
161
|
+
end
|
162
|
+
|
163
|
+
def base_path=(base_path)
|
164
|
+
# Add leading and trailing slashes to base_path
|
165
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
166
|
+
@base_path = '' if @base_path == '/'
|
167
|
+
end
|
168
|
+
|
169
|
+
# Returns base URL for specified operation based on server settings
|
170
|
+
def base_url(operation = nil)
|
171
|
+
index = server_operation_index.fetch(operation, server_index)
|
172
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
|
173
|
+
|
174
|
+
server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
175
|
+
end
|
176
|
+
|
177
|
+
# Gets API key (with prefix if set).
|
178
|
+
# @param [String] param_name the parameter name of API key auth
|
179
|
+
def api_key_with_prefix(param_name, param_alias = nil)
|
180
|
+
key = @api_key[param_name]
|
181
|
+
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
182
|
+
if @api_key_prefix[param_name]
|
183
|
+
"#{@api_key_prefix[param_name]} #{key}"
|
184
|
+
else
|
185
|
+
key
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
# Gets Basic Auth token string
|
190
|
+
def basic_auth_token
|
191
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
192
|
+
end
|
193
|
+
|
194
|
+
# Returns Auth Settings hash for api client.
|
195
|
+
def auth_settings()
|
196
|
+
result = {}
|
197
|
+
{{#authMethods}}
|
198
|
+
{{#isBasic}}
|
199
|
+
{{#isBasicBasic}}
|
200
|
+
if basic_auth_token
|
201
|
+
result['{{name}}'] = {
|
202
|
+
type: 'basic',
|
203
|
+
in: 'header',
|
204
|
+
key: 'Authorization',
|
205
|
+
value: basic_auth_token
|
206
|
+
}
|
207
|
+
end
|
208
|
+
{{/isBasicBasic}}
|
209
|
+
{{#isBasicBearer}}
|
210
|
+
if access_token
|
211
|
+
result['oauth2'] = {
|
212
|
+
type: 'bearer',
|
213
|
+
in: 'header',
|
214
|
+
{{#bearerFormat}}
|
215
|
+
format: '{{{.}}}',
|
216
|
+
{{/bearerFormat}}
|
217
|
+
key: 'Authorization',
|
218
|
+
value: "Bearer #{access_token}"
|
219
|
+
}
|
220
|
+
end
|
221
|
+
{{/isBasicBearer}}
|
222
|
+
{{/isBasic}}
|
223
|
+
{{/authMethods}}
|
224
|
+
return result
|
225
|
+
end
|
226
|
+
|
227
|
+
# Returns an array of Server setting
|
228
|
+
def server_settings
|
229
|
+
[
|
230
|
+
{{#servers}}
|
231
|
+
{
|
232
|
+
url: "#{scheme}://#{host}/#{base_path}",
|
233
|
+
description: "{{{description}}}{{^description}}No description provided{{/description}}",
|
234
|
+
{{#variables}}
|
235
|
+
{{#-first}}
|
236
|
+
variables: {
|
237
|
+
{{/-first}}
|
238
|
+
{{{name}}}: {
|
239
|
+
description: "{{{description}}}{{^description}}No description provided{{/description}}",
|
240
|
+
default_value: "{{{defaultValue}}}",
|
241
|
+
{{#enumValues}}
|
242
|
+
{{#-first}}
|
243
|
+
enum_values: [
|
244
|
+
{{/-first}}
|
245
|
+
"{{{.}}}"{{^-last}},{{/-last}}
|
246
|
+
{{#-last}}
|
247
|
+
]
|
248
|
+
{{/-last}}
|
249
|
+
{{/enumValues}}
|
250
|
+
}{{^-last}},{{/-last}}
|
251
|
+
{{#-last}}
|
252
|
+
}
|
253
|
+
{{/-last}}
|
254
|
+
{{/variables}}
|
255
|
+
}{{^-last}},{{/-last}}
|
256
|
+
{{/servers}}
|
257
|
+
]
|
258
|
+
end
|
259
|
+
|
260
|
+
def operation_server_settings
|
261
|
+
{
|
262
|
+
{{#apiInfo}}
|
263
|
+
{{#apis}}
|
264
|
+
{{#operations}}
|
265
|
+
{{#operation}}
|
266
|
+
{{#servers}}
|
267
|
+
{{#-first}}
|
268
|
+
"{{{classname}}}.{{{nickname}}}": [
|
269
|
+
{{/-first}}
|
270
|
+
{
|
271
|
+
url: "{{{url}}}",
|
272
|
+
description: "{{{description}}}{{^description}}No description provided{{/description}}",
|
273
|
+
{{#variables}}
|
274
|
+
{{#-first}}
|
275
|
+
variables: {
|
276
|
+
{{/-first}}
|
277
|
+
{{{name}}}: {
|
278
|
+
description: "{{{description}}}{{^description}}No description provided{{/description}}",
|
279
|
+
default_value: "{{{defaultValue}}}",
|
280
|
+
{{#enumValues}}
|
281
|
+
{{#-first}}
|
282
|
+
enum_values: [
|
283
|
+
{{/-first}}
|
284
|
+
"{{{.}}}"{{^-last}},{{/-last}}
|
285
|
+
{{#-last}}
|
286
|
+
]
|
287
|
+
{{/-last}}
|
288
|
+
{{/enumValues}}
|
289
|
+
}{{^-last}},{{/-last}}
|
290
|
+
{{#-last}}
|
291
|
+
}
|
292
|
+
{{/-last}}
|
293
|
+
{{/variables}}
|
294
|
+
}{{^-last}},{{/-last}}
|
295
|
+
{{#-last}}
|
296
|
+
],
|
297
|
+
{{/-last}}
|
298
|
+
{{/servers}}
|
299
|
+
{{/operation}}
|
300
|
+
{{/operations}}
|
301
|
+
{{/apis}}
|
302
|
+
{{/apiInfo}}
|
303
|
+
}
|
304
|
+
end
|
305
|
+
|
306
|
+
# Returns URL based on server settings
|
307
|
+
#
|
308
|
+
# @param index array index of the server settings
|
309
|
+
# @param variables hash of variable and the corresponding value
|
310
|
+
def server_url(index, variables = {}, servers = nil)
|
311
|
+
servers = server_settings if servers == nil
|
312
|
+
|
313
|
+
# check array index out of bound
|
314
|
+
if (index < 0 || index >= servers.size)
|
315
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
|
316
|
+
end
|
317
|
+
|
318
|
+
server = servers[index]
|
319
|
+
url = server[:url]
|
320
|
+
|
321
|
+
return url unless server.key? :variables
|
322
|
+
|
323
|
+
# go through variable and assign a value
|
324
|
+
server[:variables].each do |name, variable|
|
325
|
+
if variables.key?(name)
|
326
|
+
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
327
|
+
url.gsub! "{" + name.to_s + "}", variables[name]
|
328
|
+
else
|
329
|
+
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
330
|
+
end
|
331
|
+
else
|
332
|
+
# use default value
|
333
|
+
url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
|
334
|
+
end
|
335
|
+
end
|
336
|
+
|
337
|
+
url
|
338
|
+
end
|
339
|
+
|
340
|
+
{{#isFaraday}}
|
341
|
+
# Adds middleware to the stack
|
342
|
+
def use(*middleware)
|
343
|
+
@middlewares << middleware
|
344
|
+
end
|
345
|
+
|
346
|
+
# Adds request middleware to the stack
|
347
|
+
def request(*middleware)
|
348
|
+
@request_middlewares << middleware
|
349
|
+
end
|
350
|
+
|
351
|
+
# Adds response middleware to the stack
|
352
|
+
def response(*middleware)
|
353
|
+
@response_middlewares << middleware
|
354
|
+
end
|
355
|
+
|
356
|
+
# Set up middleware on the connection
|
357
|
+
def configure_middleware(connection)
|
358
|
+
@middlewares.each do |middleware|
|
359
|
+
connection.use(*middleware)
|
360
|
+
end
|
361
|
+
|
362
|
+
@request_middlewares.each do |middleware|
|
363
|
+
connection.request(*middleware)
|
364
|
+
end
|
365
|
+
|
366
|
+
@response_middlewares.each do |middleware|
|
367
|
+
connection.response(*middleware)
|
368
|
+
end
|
369
|
+
end
|
370
|
+
{{/isFaraday}}
|
371
|
+
end
|
372
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
=begin
|
2
|
+
{{> api_info}}
|
3
|
+
=end
|
4
|
+
|
5
|
+
require 'spec_helper'
|
6
|
+
|
7
|
+
describe {{moduleName}}::Configuration do
|
8
|
+
let(:config) { {{moduleName}}::Configuration.default }
|
9
|
+
|
10
|
+
before(:each) do
|
11
|
+
# uncomment below to setup host and base_path
|
12
|
+
# require 'URI'
|
13
|
+
# uri = URI.parse("{{{basePath}}}")
|
14
|
+
# {{moduleName}}.configure do |c|
|
15
|
+
# c.host = uri.host
|
16
|
+
# c.base_path = uri.path
|
17
|
+
# end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#base_url' do
|
21
|
+
it 'should have the default value' do
|
22
|
+
# uncomment below to test default value of the base path
|
23
|
+
# expect(config.base_url).to eq("{{{basePath}}}")
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should remove trailing slashes' do
|
27
|
+
[nil, '', '/', '//'].each do |base_path|
|
28
|
+
config.base_path = base_path
|
29
|
+
# uncomment below to test trailing slashes
|
30
|
+
# expect(config.base_url).to eq("{{{basePath}}}")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
### TLS/SSL setting
|
2
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
3
|
+
# Default to true.
|
4
|
+
#
|
5
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
6
|
+
#
|
7
|
+
# @return [true, false]
|
8
|
+
attr_accessor :ssl_verify
|
9
|
+
|
10
|
+
### TLS/SSL setting
|
11
|
+
# Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html)
|
12
|
+
#
|
13
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
14
|
+
#
|
15
|
+
attr_accessor :ssl_verify_mode
|
16
|
+
|
17
|
+
### TLS/SSL setting
|
18
|
+
# Set this to customize the certificate file to verify the peer.
|
19
|
+
#
|
20
|
+
# @return [String] the path to the certificate file
|
21
|
+
attr_accessor :ssl_ca_file
|
22
|
+
|
23
|
+
### TLS/SSL setting
|
24
|
+
# Client certificate file (for client certificate)
|
25
|
+
attr_accessor :ssl_client_cert
|
26
|
+
|
27
|
+
### TLS/SSL setting
|
28
|
+
# Client private key file (for client certificate)
|
29
|
+
attr_accessor :ssl_client_key
|
@@ -0,0 +1,34 @@
|
|
1
|
+
### TLS/SSL setting
|
2
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
3
|
+
# Default to true.
|
4
|
+
#
|
5
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
6
|
+
#
|
7
|
+
# @return [true, false]
|
8
|
+
attr_accessor :verify_ssl
|
9
|
+
|
10
|
+
### TLS/SSL setting
|
11
|
+
# Set this to false to skip verifying SSL host name
|
12
|
+
# Default to true.
|
13
|
+
#
|
14
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
15
|
+
#
|
16
|
+
# @return [true, false]
|
17
|
+
attr_accessor :verify_ssl_host
|
18
|
+
|
19
|
+
### TLS/SSL setting
|
20
|
+
# Set this to customize the certificate file to verify the peer.
|
21
|
+
#
|
22
|
+
# @return [String] the path to the certificate file
|
23
|
+
#
|
24
|
+
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
25
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
26
|
+
attr_accessor :ssl_ca_cert
|
27
|
+
|
28
|
+
### TLS/SSL setting
|
29
|
+
# Client certificate file (for client certificate)
|
30
|
+
attr_accessor :cert_file
|
31
|
+
|
32
|
+
### TLS/SSL setting
|
33
|
+
# Client private key file (for client certificate)
|
34
|
+
attr_accessor :key_file
|
@@ -0,0 +1,46 @@
|
|
1
|
+
=begin
|
2
|
+
{{> api_info}}
|
3
|
+
=end
|
4
|
+
|
5
|
+
require 'openssl'
|
6
|
+
|
7
|
+
module Dropbox
|
8
|
+
end
|
9
|
+
|
10
|
+
module Dropbox::Sign
|
11
|
+
class EventCallbackHelper
|
12
|
+
EVENT_TYPE_ACCOUNT_CALLBACK = "account_callback"
|
13
|
+
|
14
|
+
EVENT_TYPE_APP_CALLBACK = "app_callback"
|
15
|
+
|
16
|
+
# Verify that a callback came from HelloSign.com
|
17
|
+
#
|
18
|
+
# @param [String] api_key
|
19
|
+
# @param [EventCallbackRequest] event_callback
|
20
|
+
# @return bool
|
21
|
+
def self.is_valid(api_key, event_callback)
|
22
|
+
hash = OpenSSL::HMAC.hexdigest(
|
23
|
+
"SHA256",
|
24
|
+
api_key,
|
25
|
+
"#{event_callback.event.event_time}#{event_callback.event.event_type}",
|
26
|
+
)
|
27
|
+
|
28
|
+
return event_callback.event.event_hash === hash
|
29
|
+
end
|
30
|
+
|
31
|
+
# Identifies the callback type, one of "account_callback" or "app_callback".
|
32
|
+
# "app_callback" will always include a value for "reported_for_app_id"
|
33
|
+
#
|
34
|
+
# @param [EventCallbackRequest] event_callback
|
35
|
+
# @return string
|
36
|
+
def self.get_callback_type(event_callback)
|
37
|
+
metadata = event_callback.event.event_metadata || EventCallbackRequestEventMetadata.new
|
38
|
+
|
39
|
+
if metadata.reported_for_app_id.nil? || metadata.reported_for_app_id.empty?
|
40
|
+
return EVENT_TYPE_ACCOUNT_CALLBACK
|
41
|
+
end
|
42
|
+
|
43
|
+
return EVENT_TYPE_APP_CALLBACK
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|