From 097e718aa50ac835c8e1fae31b6332e0155de44f Mon Sep 17 00:00:00 2001 From: Juan Treminio <50673996+jtreminio-dropbox@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:45:21 -0500 Subject: [PATCH] Release 1.6.0 (#14) --- .gitignore | 3 +- .openapi-generator/FILES | 25 + .openapi-generator/VERSION | 2 +- README.md | 52 +- VERSION | 2 +- docs/AccountApi.md | 8 +- docs/AccountCreateRequest.md | 5 +- docs/AccountCreateResponse.md | 4 +- docs/AccountGetResponse.md | 3 +- docs/AccountResponse.md | 12 +- docs/AccountResponseQuotas.md | 7 +- docs/AccountUpdateRequest.md | 4 +- docs/AccountVerifyResponse.md | 3 +- docs/ApiAppApi.md | 10 +- docs/ApiAppCreateRequest.md | 8 +- docs/ApiAppGetResponse.md | 3 +- docs/ApiAppListResponse.md | 4 +- docs/ApiAppResponse.md | 11 +- docs/ApiAppResponseOAuth.md | 5 +- docs/ApiAppResponseOwnerAccount.md | 3 +- docs/ApiAppResponseWhiteLabelingOptions.md | 15 +- docs/ApiAppUpdateRequest.md | 8 +- docs/BulkSendJobApi.md | 4 +- docs/BulkSendJobGetResponse.md | 5 +- ...BulkSendJobGetResponseSignatureRequests.md | 26 +- docs/BulkSendJobListResponse.md | 4 +- docs/BulkSendJobResponse.md | 5 +- docs/BulkSendJobSendResponse.md | 3 +- docs/EmbeddedApi.md | 4 +- docs/EmbeddedEditUrlRequest.md | 11 +- docs/EmbeddedEditUrlResponse.md | 3 +- docs/EmbeddedEditUrlResponseEmbedded.md | 3 +- docs/EmbeddedSignUrlResponse.md | 3 +- docs/EmbeddedSignUrlResponseEmbedded.md | 3 +- docs/ErrorResponseError.md | 4 +- docs/EventCallbackRequest.md | 5 +- docs/EventCallbackRequestEvent.md | 5 +- docs/EventCallbackRequestEventMetadata.md | 5 +- docs/FaxLineAddUserRequest.md | 10 + docs/FaxLineApi.md | 665 +++++++ docs/FaxLineAreaCodeGetCountryEnum.md | 10 + docs/FaxLineAreaCodeGetProvinceEnum.md | 10 + docs/FaxLineAreaCodeGetResponse.md | 10 + docs/FaxLineAreaCodeGetStateEnum.md | 10 + docs/FaxLineCreateRequest.md | 10 + docs/FaxLineDeleteRequest.md | 10 + docs/FaxLineListResponse.md | 10 + docs/FaxLineRemoveUserRequest.md | 10 + docs/FaxLineResponse.md | 10 + docs/FaxLineResponseFaxLine.md | 10 + docs/FileResponse.md | 3 +- docs/FileResponseDataUri.md | 2 +- docs/ListInfoResponse.md | 5 +- docs/OAuthApi.md | 4 +- docs/OAuthTokenGenerateRequest.md | 6 +- docs/OAuthTokenRefreshRequest.md | 3 +- docs/OAuthTokenResponse.md | 6 +- docs/ReportApi.md | 2 +- docs/ReportCreateRequest.md | 4 +- docs/ReportCreateResponse.md | 3 +- docs/ReportResponse.md | 5 +- docs/SignatureRequestApi.md | 32 +- ...stBulkCreateEmbeddedWithTemplateRequest.md | 14 +- ...atureRequestBulkSendWithTemplateRequest.md | 14 +- docs/SignatureRequestCreateEmbeddedRequest.md | 25 +- ...equestCreateEmbeddedWithTemplateRequest.md | 16 +- docs/SignatureRequestGetResponse.md | 3 +- docs/SignatureRequestListResponse.md | 4 +- docs/SignatureRequestRemindRequest.md | 3 +- docs/SignatureRequestResponse.md | 26 +- docs/SignatureRequestResponseAttachment.md | 7 +- ...SignatureRequestResponseCustomFieldBase.md | 6 +- ...atureRequestResponseCustomFieldCheckbox.md | 3 +- ...SignatureRequestResponseCustomFieldText.md | 3 +- ...atureRequestResponseCustomFieldTypeEnum.md | 1 + docs/SignatureRequestResponseDataBase.md | 6 +- docs/SignatureRequestResponseDataTypeEnum.md | 1 + ...gnatureRequestResponseDataValueCheckbox.md | 3 +- ...reRequestResponseDataValueCheckboxMerge.md | 3 +- ...atureRequestResponseDataValueDateSigned.md | 3 +- ...gnatureRequestResponseDataValueDropdown.md | 3 +- ...gnatureRequestResponseDataValueInitials.md | 3 +- .../SignatureRequestResponseDataValueRadio.md | 3 +- ...natureRequestResponseDataValueSignature.md | 3 +- docs/SignatureRequestResponseDataValueText.md | 3 +- ...natureRequestResponseDataValueTextMerge.md | 3 +- docs/SignatureRequestResponseSignatures.md | 20 +- docs/SignatureRequestSendRequest.md | 27 +- ...SignatureRequestSendWithTemplateRequest.md | 18 +- docs/SignatureRequestUpdateRequest.md | 5 +- docs/SubAttachment.md | 5 +- docs/SubBulkSignerList.md | 3 +- docs/SubBulkSignerListCustomField.md | 3 +- docs/SubCC.md | 3 +- docs/SubCustomField.md | 5 +- docs/SubEditorOptions.md | 3 +- docs/SubFormFieldGroup.md | 4 +- docs/SubFormFieldRule.md | 5 +- docs/SubFormFieldRuleAction.md | 5 +- docs/SubFormFieldRuleTrigger.md | 5 +- docs/SubFormFieldsPerDocumentBase.md | 12 +- docs/SubFormFieldsPerDocumentCheckbox.md | 4 +- docs/SubFormFieldsPerDocumentDateSigned.md | 4 +- docs/SubFormFieldsPerDocumentDropdown.md | 6 +- docs/SubFormFieldsPerDocumentFontEnum.md | 1 + docs/SubFormFieldsPerDocumentHyperlink.md | 6 +- docs/SubFormFieldsPerDocumentRadio.md | 4 +- docs/SubFormFieldsPerDocumentText.md | 12 +- docs/SubFormFieldsPerDocumentTextMerge.md | 4 +- docs/SubFormFieldsPerDocumentTypeEnum.md | 1 + docs/SubMergeField.md | 3 +- docs/SubOAuth.md | 3 +- docs/SubSignatureRequestGroupedSigners.md | 4 +- docs/SubSignatureRequestSigner.md | 7 +- docs/SubSignatureRequestTemplateSigner.md | 7 +- docs/SubSigningOptions.md | 6 +- docs/SubTeamResponse.md | 3 +- docs/SubTemplateRole.md | 3 +- docs/SubUnclaimedDraftSigner.md | 4 +- docs/SubUnclaimedDraftTemplateSigner.md | 4 +- docs/SubWhiteLabelingOptions.md | 16 +- docs/TeamAddMemberRequest.md | 4 +- docs/TeamApi.md | 20 +- docs/TeamGetInfoResponse.md | 3 +- docs/TeamGetResponse.md | 3 +- docs/TeamInfoResponse.md | 6 +- docs/TeamInviteResponse.md | 7 +- docs/TeamInvitesResponse.md | 3 +- docs/TeamMemberResponse.md | 4 +- docs/TeamMembersResponse.md | 4 +- docs/TeamParentResponse.md | 3 +- docs/TeamRemoveMemberRequest.md | 6 +- docs/TeamResponse.md | 5 +- docs/TeamSubTeamsResponse.md | 4 +- docs/TemplateAddUserRequest.md | 4 +- docs/TemplateApi.md | 22 +- docs/TemplateCreateEmbeddedDraftRequest.md | 26 +- docs/TemplateCreateEmbeddedDraftResponse.md | 3 +- ...lateCreateEmbeddedDraftResponseTemplate.md | 5 +- docs/TemplateCreateRequest.md | 19 +- docs/TemplateCreateResponse.md | 3 +- docs/TemplateEditResponse.md | 2 +- docs/TemplateGetResponse.md | 3 +- docs/TemplateListResponse.md | 4 +- docs/TemplateRemoveUserRequest.md | 3 +- docs/TemplateResponse.md | 16 +- docs/TemplateResponseAccount.md | 7 +- docs/TemplateResponseAccountQuota.md | 5 +- docs/TemplateResponseDocument.md | 7 +- ...TemplateResponseDocumentCustomFieldBase.md | 11 +- ...TemplateResponseDocumentCustomFieldText.md | 6 +- docs/TemplateResponseDocumentFieldGroup.md | 3 +- .../TemplateResponseDocumentFieldGroupRule.md | 3 +- docs/TemplateResponseDocumentFormFieldBase.md | 11 +- ...plateResponseDocumentFormFieldHyperlink.md | 6 +- docs/TemplateResponseDocumentFormFieldText.md | 7 +- ...TemplateResponseDocumentStaticFieldBase.md | 11 +- docs/TemplateResponseFieldAvgTextLength.md | 3 +- docs/TemplateResponseSignerRole.md | 3 +- docs/TemplateUpdateFilesRequest.md | 7 +- docs/TemplateUpdateFilesResponse.md | 2 +- docs/TemplateUpdateFilesResponseTemplate.md | 3 +- docs/UnclaimedDraftApi.md | 8 +- docs/UnclaimedDraftCreateEmbeddedRequest.md | 37 +- ...dDraftCreateEmbeddedWithTemplateRequest.md | 31 +- docs/UnclaimedDraftCreateRequest.md | 25 +- docs/UnclaimedDraftCreateResponse.md | 3 +- docs/UnclaimedDraftEditAndResendRequest.md | 9 +- docs/UnclaimedDraftResponse.md | 7 +- docs/WarningResponse.md | 3 +- examples/FaxLineAddUser.cs | 34 + examples/FaxLineAreaCodeGet.cs | 29 + examples/FaxLineCreate.cs | 34 + examples/FaxLineDelete.cs | 32 + examples/FaxLineGet.cs | 29 + examples/FaxLineList.cs | 29 + examples/FaxLineRemoveUser.cs | 34 + openapi-config.yaml | 9 +- openapi-sdk.yaml | 1080 ++++++++++ run-build | 5 +- src/Dropbox.Sign.Test/Api/ApiAppApiTests.cs | 36 +- .../Dropbox.Sign.Test.csproj | 4 +- src/Dropbox.Sign.Test/MockRestClientHelper.cs | 155 +- src/Dropbox.Sign/Api/AccountApi.cs | 41 +- src/Dropbox.Sign/Api/ApiAppApi.cs | 53 +- src/Dropbox.Sign/Api/BulkSendJobApi.cs | 22 +- src/Dropbox.Sign/Api/EmbeddedApi.cs | 21 +- src/Dropbox.Sign/Api/FaxLineApi.cs | 1740 +++++++++++++++++ src/Dropbox.Sign/Api/OAuthApi.cs | 20 +- src/Dropbox.Sign/Api/ReportApi.cs | 10 +- src/Dropbox.Sign/Api/SignatureRequestApi.cs | 168 +- src/Dropbox.Sign/Api/TeamApi.cs | 106 +- src/Dropbox.Sign/Api/TemplateApi.cs | 116 +- src/Dropbox.Sign/Api/UnclaimedDraftApi.cs | 40 +- src/Dropbox.Sign/Client/ApiClient.cs | 333 ++-- src/Dropbox.Sign/Client/ClientUtils.cs | 14 +- src/Dropbox.Sign/Client/Configuration.cs | 37 +- .../Client/IAsynchronousClient.cs | 14 +- .../Client/IReadableConfiguration.cs | 12 + src/Dropbox.Sign/Client/RequestOptions.cs | 2 +- src/Dropbox.Sign/Dropbox.Sign.csproj | 17 +- .../Model/AbstractOpenAPISchema.cs | 2 +- .../Model/AccountCreateRequest.cs | 29 +- .../Model/AccountCreateResponse.cs | 36 +- src/Dropbox.Sign/Model/AccountGetResponse.cs | 34 +- src/Dropbox.Sign/Model/AccountResponse.cs | 43 +- .../Model/AccountResponseQuotas.cs | 33 +- .../Model/AccountResponseUsage.cs | 23 +- .../Model/AccountUpdateRequest.cs | 27 +- .../Model/AccountVerifyRequest.cs | 23 +- .../Model/AccountVerifyResponse.cs | 25 +- .../Model/AccountVerifyResponseAccount.cs | 23 +- src/Dropbox.Sign/Model/ApiAppCreateRequest.cs | 35 +- src/Dropbox.Sign/Model/ApiAppGetResponse.cs | 34 +- src/Dropbox.Sign/Model/ApiAppListResponse.cs | 45 +- src/Dropbox.Sign/Model/ApiAppResponse.cs | 41 +- src/Dropbox.Sign/Model/ApiAppResponseOAuth.cs | 29 +- .../Model/ApiAppResponseOptions.cs | 23 +- .../Model/ApiAppResponseOwnerAccount.cs | 25 +- .../ApiAppResponseWhiteLabelingOptions.cs | 49 +- src/Dropbox.Sign/Model/ApiAppUpdateRequest.cs | 35 +- .../Model/BulkSendJobGetResponse.cs | 56 +- ...BulkSendJobGetResponseSignatureRequests.cs | 71 +- .../Model/BulkSendJobListResponse.cs | 45 +- src/Dropbox.Sign/Model/BulkSendJobResponse.cs | 29 +- .../Model/BulkSendJobSendResponse.cs | 34 +- .../Model/EmbeddedEditUrlRequest.cs | 41 +- .../Model/EmbeddedEditUrlResponse.cs | 34 +- .../Model/EmbeddedEditUrlResponseEmbedded.cs | 25 +- .../Model/EmbeddedSignUrlResponse.cs | 34 +- .../Model/EmbeddedSignUrlResponseEmbedded.cs | 25 +- src/Dropbox.Sign/Model/ErrorResponse.cs | 23 +- src/Dropbox.Sign/Model/ErrorResponseError.cs | 27 +- .../Model/EventCallbackRequest.cs | 41 +- .../Model/EventCallbackRequestEvent.cs | 28 +- .../EventCallbackRequestEventMetadata.cs | 29 +- src/Dropbox.Sign/Model/FaxLine.cs | 241 +++ .../Model/FaxLineAddUserRequest.cs | 221 +++ .../Model/FaxLineAreaCodeGetCountryEnum.cs | 54 + .../Model/FaxLineAreaCodeGetProvinceEnum.cs | 114 ++ .../Model/FaxLineAreaCodeGetResponse.cs | 170 ++ .../Model/FaxLineAreaCodeGetStateEnum.cs | 342 ++++ .../Model/FaxLineCreateRequest.cs | 259 +++ .../Model/FaxLineDeleteRequest.cs | 170 ++ src/Dropbox.Sign/Model/FaxLineListResponse.cs | 223 +++ .../Model/FaxLineRemoveUserRequest.cs | 221 +++ src/Dropbox.Sign/Model/FaxLineResponse.cs | 193 ++ .../Model/FaxLineResponseFaxLine.cs | 232 +++ src/Dropbox.Sign/Model/FileResponse.cs | 38 +- src/Dropbox.Sign/Model/FileResponseDataUri.cs | 32 +- src/Dropbox.Sign/Model/ListInfoResponse.cs | 29 +- .../Model/OAuthTokenGenerateRequest.cs | 33 +- .../Model/OAuthTokenRefreshRequest.cs | 27 +- src/Dropbox.Sign/Model/OAuthTokenResponse.cs | 31 +- src/Dropbox.Sign/Model/ReportCreateRequest.cs | 50 +- .../Model/ReportCreateResponse.cs | 34 +- src/Dropbox.Sign/Model/ReportResponse.cs | 52 +- ...stBulkCreateEmbeddedWithTemplateRequest.cs | 83 +- ...atureRequestBulkSendWithTemplateRequest.cs | 83 +- .../SignatureRequestCreateEmbeddedRequest.cs | 105 +- ...equestCreateEmbeddedWithTemplateRequest.cs | 87 +- .../Model/SignatureRequestGetResponse.cs | 34 +- .../Model/SignatureRequestListResponse.cs | 45 +- .../Model/SignatureRequestRemindRequest.cs | 25 +- .../Model/SignatureRequestResponse.cs | 71 +- .../SignatureRequestResponseAttachment.cs | 41 +- ...SignatureRequestResponseCustomFieldBase.cs | 53 +- ...atureRequestResponseCustomFieldCheckbox.cs | 51 +- ...SignatureRequestResponseCustomFieldText.cs | 51 +- ...atureRequestResponseCustomFieldTypeEnum.cs | 1 - .../Model/SignatureRequestResponseDataBase.cs | 60 +- .../SignatureRequestResponseDataTypeEnum.cs | 1 - ...gnatureRequestResponseDataValueCheckbox.cs | 58 +- ...reRequestResponseDataValueCheckboxMerge.cs | 58 +- ...atureRequestResponseDataValueDateSigned.cs | 58 +- ...gnatureRequestResponseDataValueDropdown.cs | 58 +- ...gnatureRequestResponseDataValueInitials.cs | 58 +- .../SignatureRequestResponseDataValueRadio.cs | 58 +- ...natureRequestResponseDataValueSignature.cs | 58 +- .../SignatureRequestResponseDataValueText.cs | 58 +- ...natureRequestResponseDataValueTextMerge.cs | 58 +- .../SignatureRequestResponseSignatures.cs | 59 +- .../Model/SignatureRequestSendRequest.cs | 109 +- ...SignatureRequestSendWithTemplateRequest.cs | 91 +- .../Model/SignatureRequestUpdateRequest.cs | 29 +- src/Dropbox.Sign/Model/SubAttachment.cs | 29 +- src/Dropbox.Sign/Model/SubBulkSignerList.cs | 25 +- .../Model/SubBulkSignerListCustomField.cs | 25 +- src/Dropbox.Sign/Model/SubCC.cs | 25 +- src/Dropbox.Sign/Model/SubCustomField.cs | 29 +- src/Dropbox.Sign/Model/SubEditorOptions.cs | 25 +- src/Dropbox.Sign/Model/SubFieldOptions.cs | 22 +- src/Dropbox.Sign/Model/SubFormFieldGroup.cs | 27 +- src/Dropbox.Sign/Model/SubFormFieldRule.cs | 31 +- .../Model/SubFormFieldRuleAction.cs | 28 +- .../Model/SubFormFieldRuleTrigger.cs | 34 +- .../Model/SubFormFieldsPerDocumentBase.cs | 72 +- .../Model/SubFormFieldsPerDocumentCheckbox.cs | 67 +- .../SubFormFieldsPerDocumentCheckboxMerge.cs | 45 +- .../SubFormFieldsPerDocumentDateSigned.cs | 66 +- .../Model/SubFormFieldsPerDocumentDropdown.cs | 70 +- .../Model/SubFormFieldsPerDocumentFontEnum.cs | 1 - .../SubFormFieldsPerDocumentHyperlink.cs | 70 +- .../Model/SubFormFieldsPerDocumentInitials.cs | 45 +- .../Model/SubFormFieldsPerDocumentRadio.cs | 67 +- .../SubFormFieldsPerDocumentSignature.cs | 45 +- .../Model/SubFormFieldsPerDocumentText.cs | 81 +- .../SubFormFieldsPerDocumentTextMerge.cs | 66 +- .../Model/SubFormFieldsPerDocumentTypeEnum.cs | 1 - src/Dropbox.Sign/Model/SubMergeField.cs | 24 +- src/Dropbox.Sign/Model/SubOAuth.cs | 48 +- src/Dropbox.Sign/Model/SubOptions.cs | 23 +- .../SubSignatureRequestGroupedSigners.cs | 27 +- .../Model/SubSignatureRequestSigner.cs | 56 +- .../SubSignatureRequestTemplateSigner.cs | 56 +- src/Dropbox.Sign/Model/SubSigningOptions.cs | 30 +- src/Dropbox.Sign/Model/SubTeamResponse.cs | 25 +- src/Dropbox.Sign/Model/SubTemplateRole.cs | 25 +- .../Model/SubUnclaimedDraftSigner.cs | 27 +- .../Model/SubUnclaimedDraftTemplateSigner.cs | 27 +- .../Model/SubWhiteLabelingOptions.cs | 52 +- .../Model/TeamAddMemberRequest.cs | 26 +- src/Dropbox.Sign/Model/TeamCreateRequest.cs | 25 +- src/Dropbox.Sign/Model/TeamGetInfoResponse.cs | 34 +- src/Dropbox.Sign/Model/TeamGetResponse.cs | 34 +- src/Dropbox.Sign/Model/TeamInfoResponse.cs | 31 +- src/Dropbox.Sign/Model/TeamInviteResponse.cs | 33 +- src/Dropbox.Sign/Model/TeamInvitesResponse.cs | 34 +- src/Dropbox.Sign/Model/TeamMemberResponse.cs | 27 +- src/Dropbox.Sign/Model/TeamMembersResponse.cs | 45 +- src/Dropbox.Sign/Model/TeamParentResponse.cs | 25 +- .../Model/TeamRemoveMemberRequest.cs | 30 +- src/Dropbox.Sign/Model/TeamResponse.cs | 29 +- .../Model/TeamSubTeamsResponse.cs | 45 +- src/Dropbox.Sign/Model/TeamUpdateRequest.cs | 23 +- .../Model/TemplateAddUserRequest.cs | 27 +- .../TemplateCreateEmbeddedDraftRequest.cs | 95 +- .../TemplateCreateEmbeddedDraftResponse.cs | 34 +- ...lateCreateEmbeddedDraftResponseTemplate.cs | 29 +- .../Model/TemplateCreateRequest.cs | 81 +- .../Model/TemplateCreateResponse.cs | 34 +- .../Model/TemplateCreateResponseTemplate.cs | 23 +- .../Model/TemplateEditResponse.cs | 32 +- src/Dropbox.Sign/Model/TemplateGetResponse.cs | 34 +- .../Model/TemplateListResponse.cs | 45 +- .../Model/TemplateRemoveUserRequest.cs | 25 +- src/Dropbox.Sign/Model/TemplateResponse.cs | 51 +- .../Model/TemplateResponseAccount.cs | 33 +- .../Model/TemplateResponseAccountQuota.cs | 29 +- .../Model/TemplateResponseCCRole.cs | 23 +- .../Model/TemplateResponseDocument.cs | 33 +- ...TemplateResponseDocumentCustomFieldBase.cs | 71 +- ...lateResponseDocumentCustomFieldCheckbox.cs | 39 +- ...TemplateResponseDocumentCustomFieldText.cs | 65 +- .../TemplateResponseDocumentFieldGroup.cs | 25 +- .../TemplateResponseDocumentFieldGroupRule.cs | 25 +- .../TemplateResponseDocumentFormFieldBase.cs | 77 +- ...mplateResponseDocumentFormFieldCheckbox.cs | 45 +- ...lateResponseDocumentFormFieldDateSigned.cs | 45 +- ...mplateResponseDocumentFormFieldDropdown.cs | 45 +- ...plateResponseDocumentFormFieldHyperlink.cs | 71 +- ...mplateResponseDocumentFormFieldInitials.cs | 45 +- .../TemplateResponseDocumentFormFieldRadio.cs | 45 +- ...plateResponseDocumentFormFieldSignature.cs | 45 +- .../TemplateResponseDocumentFormFieldText.cs | 72 +- ...TemplateResponseDocumentStaticFieldBase.cs | 71 +- ...lateResponseDocumentStaticFieldCheckbox.cs | 43 +- ...teResponseDocumentStaticFieldDateSigned.cs | 43 +- ...lateResponseDocumentStaticFieldDropdown.cs | 43 +- ...ateResponseDocumentStaticFieldHyperlink.cs | 43 +- ...lateResponseDocumentStaticFieldInitials.cs | 43 +- ...emplateResponseDocumentStaticFieldRadio.cs | 43 +- ...ateResponseDocumentStaticFieldSignature.cs | 43 +- ...TemplateResponseDocumentStaticFieldText.cs | 43 +- .../TemplateResponseFieldAvgTextLength.cs | 25 +- .../Model/TemplateResponseSignerRole.cs | 25 +- .../Model/TemplateUpdateFilesRequest.cs | 57 +- .../Model/TemplateUpdateFilesResponse.cs | 32 +- .../TemplateUpdateFilesResponseTemplate.cs | 25 +- .../UnclaimedDraftCreateEmbeddedRequest.cs | 116 +- ...dDraftCreateEmbeddedWithTemplateRequest.cs | 117 +- .../Model/UnclaimedDraftCreateRequest.cs | 92 +- .../Model/UnclaimedDraftCreateResponse.cs | 34 +- .../UnclaimedDraftEditAndResendRequest.cs | 37 +- .../Model/UnclaimedDraftResponse.cs | 33 +- src/Dropbox.Sign/Model/WarningResponse.cs | 25 +- templates/AbstractOpenAPISchema.mustache | 6 +- templates/ApiClient.mustache | 382 ++-- templates/ApiException.mustache | 12 + templates/ClientUtils.mustache | 33 +- templates/Configuration.mustache | 52 +- templates/HttpSigningConfiguration.mustache | 149 +- templates/IAsynchronousClient.mustache | 14 +- templates/IReadableConfiguration.mustache | 18 + templates/NullConditionalParameter.mustache | 1 + templates/NullConditionalProperty.mustache | 1 + templates/README.mustache | 187 +- templates/RequestOptions.mustache | 6 +- templates/Solution.mustache | 8 +- templates/TestProject.mustache | 9 +- templates/ValidateRegex.mustache | 6 + templates/api.mustache | 110 +- templates/api_doc.mustache | 84 +- templates/auth/OAuthAuthenticator.mustache | 29 +- templates/gitignore.mustache | 7 +- ...terOperationDefaultImplementation.mustache | 2 + .../generichost/ApiException.mustache | 4 +- .../libraries/generichost/ApiFactory.mustache | 49 + .../generichost/ApiKeyToken.mustache | 37 +- .../ApiResponseEventArgs`1.mustache | 24 + .../generichost/ApiResponse`1.mustache | 140 +- .../generichost/ApiTestsBase.mustache | 56 +- .../libraries/generichost/AsModel.mustache | 4 + .../libraries/generichost/Assembly.mustache | 2 + .../libraries/generichost/BasicToken.mustache | 6 +- .../generichost/BearerToken.mustache | 6 +- .../generichost/ClientUtils.mustache | 292 ++- .../generichost/CookieContainer.mustache | 22 + .../generichost/DateFormats.mustache | 2 + .../DateOnlyJsonConverter.mustache | 51 + .../DateOnlyNullableJsonConverter.mustache | 56 + .../generichost/DateTimeFormats.mustache | 22 + .../DateTimeJsonConverter.mustache | 51 + .../DateTimeNullableJsonConverter.mustache | 56 + .../DependencyInjectionTests.mustache | 209 +- .../generichost/EnumValueDataType.mustache | 1 + .../generichost/ExceptionEventArgs.mustache | 24 + .../generichost/HostConfiguration.mustache | 99 +- .../HttpSigningConfiguration.mustache | 78 +- .../generichost/HttpSigningToken.mustache | 6 +- templates/libraries/generichost/IApi.mustache | 10 +- .../IHostBuilderExtensions.mustache | 55 + .../IHttpClientBuilderExtensions.mustache | 75 + .../IServiceCollectionExtensions.mustache | 69 + .../generichost/ImplementsIEquatable.mustache | 1 + .../ImplementsValidatable.mustache | 1 + .../generichost/JsonConverter.mustache | 641 +++++- .../JsonSerializerOptionsProvider.mustache | 4 +- .../generichost/ModelBaseSignature.mustache | 1 + .../generichost/ModelSignature.mustache | 1 + .../libraries/generichost/OAuthToken.mustache | 6 +- .../OnDeserializationError.mustache | 2 + .../OnErrorDefaultImplementation.mustache | 2 + .../generichost/OperationSignature.mustache | 1 + .../libraries/generichost/Option.mustache | 47 + .../generichost/OptionProperty.mustache | 1 + .../generichost/README.client.mustache | 245 +++ .../generichost/README.solution.mustache | 1 + .../generichost/README.test.mustache | 0 .../generichost/RateLimitProvider`1.mustache | 112 +- .../SourceGenerationContext.mustache | 9 + .../libraries/generichost/TokenBase.mustache | 6 +- .../generichost/TokenContainer`1.mustache | 6 +- .../generichost/TokenProvider`1.mustache | 6 +- .../generichost/ValidateRegex.mustache | 7 + .../generichost/WriteProperty.mustache | 9 + .../generichost/WritePropertyHelper.mustache | 9 + templates/libraries/generichost/api.mustache | 841 +++++--- .../libraries/generichost/api_test.mustache | 17 +- .../generichost/git_push.ps1.mustache | 2 +- .../libraries/generichost/model.mustache | 31 +- .../generichost/modelGeneric.mustache | 268 ++- .../generichost/testInstructions.mustache | 18 + .../libraries/httpclient/ApiClient.mustache | 79 +- .../httpclient/RequestOptions.mustache | 2 +- templates/libraries/httpclient/api.mustache | 26 +- .../unityWebRequest/ApiClient.mustache | 639 ++++++ .../ConnectionException.mustache | 21 + .../libraries/unityWebRequest/README.mustache | 175 ++ .../unityWebRequest/RequestOptions.mustache | 60 + .../UnexpectedResponseException.mustache | 26 + .../libraries/unityWebRequest/api.mustache | 690 +++++++ .../unityWebRequest/api_test.mustache | 74 + .../libraries/unityWebRequest/asmdef.mustache | 7 + .../unityWebRequest/asmdef_test.mustache | 15 + .../libraries/unityWebRequest/model.mustache | 47 + .../unityWebRequest/model_test.mustache | 64 + templates/modelAnyOf.mustache | 68 +- templates/modelEnum.mustache | 151 +- templates/modelGeneric.mustache | 135 +- templates/modelInnerEnum.mustache | 75 +- templates/modelOneOf.mustache | 48 +- templates/model_doc.mustache | 12 +- templates/model_test.mustache | 16 +- templates/netcore_project.additions.mustache | 1 + templates/netcore_project.mustache | 77 +- .../netcore_testproject.additions.mustache | 1 + templates/netcore_testproject.mustache | 9 +- templates/nuspec.mustache | 13 +- templates/openapi.mustache | 1 + templates/validatable.mustache | 79 +- 491 files changed, 16870 insertions(+), 6614 deletions(-) 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 examples/FaxLineAddUser.cs create mode 100644 examples/FaxLineAreaCodeGet.cs create mode 100644 examples/FaxLineCreate.cs create mode 100644 examples/FaxLineDelete.cs create mode 100644 examples/FaxLineGet.cs create mode 100644 examples/FaxLineList.cs create mode 100644 examples/FaxLineRemoveUser.cs create mode 100644 src/Dropbox.Sign/Api/FaxLineApi.cs create mode 100644 src/Dropbox.Sign/Model/FaxLine.cs create mode 100644 src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs create mode 100644 src/Dropbox.Sign/Model/FaxLineAreaCodeGetCountryEnum.cs create mode 100644 src/Dropbox.Sign/Model/FaxLineAreaCodeGetProvinceEnum.cs create mode 100644 src/Dropbox.Sign/Model/FaxLineAreaCodeGetResponse.cs create mode 100644 src/Dropbox.Sign/Model/FaxLineAreaCodeGetStateEnum.cs create mode 100644 src/Dropbox.Sign/Model/FaxLineCreateRequest.cs create mode 100644 src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs create mode 100644 src/Dropbox.Sign/Model/FaxLineListResponse.cs create mode 100644 src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs create mode 100644 src/Dropbox.Sign/Model/FaxLineResponse.cs create mode 100644 src/Dropbox.Sign/Model/FaxLineResponseFaxLine.cs create mode 100644 templates/NullConditionalParameter.mustache create mode 100644 templates/NullConditionalProperty.mustache create mode 100644 templates/ValidateRegex.mustache create mode 100644 templates/libraries/generichost/AfterOperationDefaultImplementation.mustache create mode 100644 templates/libraries/generichost/ApiFactory.mustache create mode 100644 templates/libraries/generichost/ApiResponseEventArgs`1.mustache create mode 100644 templates/libraries/generichost/AsModel.mustache create mode 100644 templates/libraries/generichost/Assembly.mustache create mode 100644 templates/libraries/generichost/CookieContainer.mustache create mode 100644 templates/libraries/generichost/DateFormats.mustache create mode 100644 templates/libraries/generichost/DateOnlyJsonConverter.mustache create mode 100644 templates/libraries/generichost/DateOnlyNullableJsonConverter.mustache create mode 100644 templates/libraries/generichost/DateTimeFormats.mustache create mode 100644 templates/libraries/generichost/DateTimeJsonConverter.mustache create mode 100644 templates/libraries/generichost/DateTimeNullableJsonConverter.mustache create mode 100644 templates/libraries/generichost/EnumValueDataType.mustache create mode 100644 templates/libraries/generichost/ExceptionEventArgs.mustache create mode 100644 templates/libraries/generichost/IHostBuilderExtensions.mustache create mode 100644 templates/libraries/generichost/IHttpClientBuilderExtensions.mustache create mode 100644 templates/libraries/generichost/IServiceCollectionExtensions.mustache create mode 100644 templates/libraries/generichost/ImplementsIEquatable.mustache create mode 100644 templates/libraries/generichost/ImplementsValidatable.mustache create mode 100644 templates/libraries/generichost/ModelBaseSignature.mustache create mode 100644 templates/libraries/generichost/ModelSignature.mustache create mode 100644 templates/libraries/generichost/OnDeserializationError.mustache create mode 100644 templates/libraries/generichost/OnErrorDefaultImplementation.mustache create mode 100644 templates/libraries/generichost/OperationSignature.mustache create mode 100644 templates/libraries/generichost/Option.mustache create mode 100644 templates/libraries/generichost/OptionProperty.mustache create mode 100644 templates/libraries/generichost/README.client.mustache create mode 100644 templates/libraries/generichost/README.solution.mustache create mode 100644 templates/libraries/generichost/README.test.mustache create mode 100644 templates/libraries/generichost/SourceGenerationContext.mustache create mode 100644 templates/libraries/generichost/ValidateRegex.mustache create mode 100644 templates/libraries/generichost/WriteProperty.mustache create mode 100644 templates/libraries/generichost/WritePropertyHelper.mustache create mode 100644 templates/libraries/generichost/testInstructions.mustache create mode 100644 templates/libraries/unityWebRequest/ApiClient.mustache create mode 100644 templates/libraries/unityWebRequest/ConnectionException.mustache create mode 100644 templates/libraries/unityWebRequest/README.mustache create mode 100644 templates/libraries/unityWebRequest/RequestOptions.mustache create mode 100644 templates/libraries/unityWebRequest/UnexpectedResponseException.mustache create mode 100644 templates/libraries/unityWebRequest/api.mustache create mode 100644 templates/libraries/unityWebRequest/api_test.mustache create mode 100644 templates/libraries/unityWebRequest/asmdef.mustache create mode 100644 templates/libraries/unityWebRequest/asmdef_test.mustache create mode 100644 templates/libraries/unityWebRequest/model.mustache create mode 100644 templates/libraries/unityWebRequest/model_test.mustache create mode 100644 templates/netcore_project.additions.mustache create mode 100644 templates/netcore_testproject.additions.mustache create mode 100644 templates/openapi.mustache diff --git a/.gitignore b/.gitignore index 0a5d07c..02e0c34 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ x86/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ +#[Bb]in/ [Oo]bj/ [Ll]og/ [Ll]ogs/ @@ -361,5 +362,5 @@ MigrationBackup/ FodyWeavers.xsd vendor - +/api .openapi-generator diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 453ed35..9969434 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -2,6 +2,7 @@ Dropbox.Sign.sln README.md VERSION +api/openapi.yaml appveyor.yml docs/AccountApi.md docs/AccountCreateRequest.md @@ -41,6 +42,18 @@ docs/ErrorResponseError.md docs/EventCallbackRequest.md docs/EventCallbackRequestEvent.md docs/EventCallbackRequestEventMetadata.md +docs/FaxLineAddUserRequest.md +docs/FaxLineApi.md +docs/FaxLineAreaCodeGetCountryEnum.md +docs/FaxLineAreaCodeGetProvinceEnum.md +docs/FaxLineAreaCodeGetResponse.md +docs/FaxLineAreaCodeGetStateEnum.md +docs/FaxLineCreateRequest.md +docs/FaxLineDeleteRequest.md +docs/FaxLineListResponse.md +docs/FaxLineRemoveUserRequest.md +docs/FaxLineResponse.md +docs/FaxLineResponseFaxLine.md docs/FileResponse.md docs/FileResponseDataUri.md docs/ListInfoResponse.md @@ -189,6 +202,7 @@ src/Dropbox.Sign/Api/AccountApi.cs src/Dropbox.Sign/Api/ApiAppApi.cs src/Dropbox.Sign/Api/BulkSendJobApi.cs src/Dropbox.Sign/Api/EmbeddedApi.cs +src/Dropbox.Sign/Api/FaxLineApi.cs src/Dropbox.Sign/Api/OAuthApi.cs src/Dropbox.Sign/Api/ReportApi.cs src/Dropbox.Sign/Api/SignatureRequestApi.cs @@ -248,6 +262,17 @@ src/Dropbox.Sign/Model/ErrorResponseError.cs src/Dropbox.Sign/Model/EventCallbackRequest.cs src/Dropbox.Sign/Model/EventCallbackRequestEvent.cs src/Dropbox.Sign/Model/EventCallbackRequestEventMetadata.cs +src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs +src/Dropbox.Sign/Model/FaxLineAreaCodeGetCountryEnum.cs +src/Dropbox.Sign/Model/FaxLineAreaCodeGetProvinceEnum.cs +src/Dropbox.Sign/Model/FaxLineAreaCodeGetResponse.cs +src/Dropbox.Sign/Model/FaxLineAreaCodeGetStateEnum.cs +src/Dropbox.Sign/Model/FaxLineCreateRequest.cs +src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs +src/Dropbox.Sign/Model/FaxLineListResponse.cs +src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs +src/Dropbox.Sign/Model/FaxLineResponse.cs +src/Dropbox.Sign/Model/FaxLineResponseFaxLine.cs src/Dropbox.Sign/Model/FileResponse.cs src/Dropbox.Sign/Model/FileResponseDataUri.cs src/Dropbox.Sign/Model/ListInfoResponse.cs diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index f4965a3..09a6d30 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.0.0 \ No newline at end of file +7.8.0 diff --git a/README.md b/README.md index 6d253ae..2f43373 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,9 @@ directory that corresponds to the file you want updated. This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 3.0.0 -- SDK version: 1.5.0 -- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen +- SDK version: 1.6.0 +- Generator version: 7.8.0 +- Build package: org.openapitools.codegen.languages.CSharpClientCodegen ### Building @@ -42,18 +43,18 @@ Run the following and everything is done for you: to the OAS file and/or the mustache template files _will be lost_ when you run this command. - + ## Frameworks supported - + ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 108.0.1 or later -- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.1 or later -- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.9.0 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later - [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later - + ## Installation & Usage ### NuGet Package Manager @@ -74,9 +75,11 @@ webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials; c.Proxy = webProxy; ``` - + + ## Getting Started + ```csharp using System; @@ -117,7 +120,8 @@ public class Example ``` - + + ## Documentation for API Endpoints All URIs are relative to *https://api.hellosign.com/v3* @@ -137,6 +141,13 @@ Class | Method | HTTP request | Description *BulkSendJobApi* | [**BulkSendJobList**](docs/BulkSendJobApi.md#bulksendjoblist) | **GET** /bulk_send_job/list | List Bulk Send Jobs *EmbeddedApi* | [**EmbeddedEditUrl**](docs/EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL *EmbeddedApi* | [**EmbeddedSignUrl**](docs/EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL +*FaxLineApi* | [**FaxLineAddUser**](docs/FaxLineApi.md#faxlineadduser) | **PUT** /fax_line/add_user | Add Fax Line User +*FaxLineApi* | [**FaxLineAreaCodeGet**](docs/FaxLineApi.md#faxlineareacodeget) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes +*FaxLineApi* | [**FaxLineCreate**](docs/FaxLineApi.md#faxlinecreate) | **POST** /fax_line/create | Purchase Fax Line +*FaxLineApi* | [**FaxLineDelete**](docs/FaxLineApi.md#faxlinedelete) | **DELETE** /fax_line | Delete Fax Line +*FaxLineApi* | [**FaxLineGet**](docs/FaxLineApi.md#faxlineget) | **GET** /fax_line | Get Fax Line +*FaxLineApi* | [**FaxLineList**](docs/FaxLineApi.md#faxlinelist) | **GET** /fax_line/list | List Fax Lines +*FaxLineApi* | [**FaxLineRemoveUser**](docs/FaxLineApi.md#faxlineremoveuser) | **PUT** /fax_line/remove_user | Remove Fax Line Access *OAuthApi* | [**OauthTokenGenerate**](docs/OAuthApi.md#oauthtokengenerate) | **POST** /oauth/token | OAuth Token Generate *OAuthApi* | [**OauthTokenRefresh**](docs/OAuthApi.md#oauthtokenrefresh) | **POST** /oauth/token?refresh | OAuth Token Refresh *ReportApi* | [**ReportCreate**](docs/ReportApi.md#reportcreate) | **POST** /report/create | Create Report @@ -183,7 +194,7 @@ Class | Method | HTTP request | Description *UnclaimedDraftApi* | [**UnclaimedDraftEditAndResend**](docs/UnclaimedDraftApi.md#unclaimeddrafteditandresend) | **POST** /unclaimed_draft/edit_and_resend/{signature_request_id} | Edit and Resend Unclaimed Draft - + ## Documentation for Models - [Model.AccountCreateRequest](docs/AccountCreateRequest.md) @@ -220,6 +231,17 @@ Class | Method | HTTP request | Description - [Model.EventCallbackRequest](docs/EventCallbackRequest.md) - [Model.EventCallbackRequestEvent](docs/EventCallbackRequestEvent.md) - [Model.EventCallbackRequestEventMetadata](docs/EventCallbackRequestEventMetadata.md) + - [Model.FaxLineAddUserRequest](docs/FaxLineAddUserRequest.md) + - [Model.FaxLineAreaCodeGetCountryEnum](docs/FaxLineAreaCodeGetCountryEnum.md) + - [Model.FaxLineAreaCodeGetProvinceEnum](docs/FaxLineAreaCodeGetProvinceEnum.md) + - [Model.FaxLineAreaCodeGetResponse](docs/FaxLineAreaCodeGetResponse.md) + - [Model.FaxLineAreaCodeGetStateEnum](docs/FaxLineAreaCodeGetStateEnum.md) + - [Model.FaxLineCreateRequest](docs/FaxLineCreateRequest.md) + - [Model.FaxLineDeleteRequest](docs/FaxLineDeleteRequest.md) + - [Model.FaxLineListResponse](docs/FaxLineListResponse.md) + - [Model.FaxLineRemoveUserRequest](docs/FaxLineRemoveUserRequest.md) + - [Model.FaxLineResponse](docs/FaxLineResponse.md) + - [Model.FaxLineResponseFaxLine](docs/FaxLineResponseFaxLine.md) - [Model.FileResponse](docs/FileResponse.md) - [Model.FileResponseDataUri](docs/FileResponseDataUri.md) - [Model.ListInfoResponse](docs/ListInfoResponse.md) @@ -360,15 +382,17 @@ Class | Method | HTTP request | Description - [Model.WarningResponse](docs/WarningResponse.md) - + ## Documentation for Authorization - + +Authentication schemes defined for the API: + ### api_key - **Type**: HTTP basic authentication - + ### oauth2 - **Type**: Bearer Authentication 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/docs/AccountApi.md b/docs/AccountApi.md index 017c8e5..897f4d2 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -9,7 +9,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**AccountUpdate**](AccountApi.md#accountupdate) | **PUT** /account | Update Account | | [**AccountVerify**](AccountApi.md#accountverify) | **POST** /account/verify | Verify Account | - + # **AccountCreate** > AccountCreateResponse AccountCreate (AccountCreateRequest accountCreateRequest) @@ -106,7 +106,7 @@ catch (ApiException e) [[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) - + # **AccountGet** > AccountGetResponse AccountGet (string? accountId = null, string? emailAddress = null) @@ -200,7 +200,7 @@ catch (ApiException e) [[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) - + # **AccountUpdate** > AccountGetResponse AccountUpdate (AccountUpdateRequest accountUpdateRequest) @@ -297,7 +297,7 @@ catch (ApiException e) [[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) - + # **AccountVerify** > AccountVerifyResponse AccountVerify (AccountVerifyRequest accountVerifyRequest) diff --git a/docs/AccountCreateRequest.md b/docs/AccountCreateRequest.md index ce037d7..4e1279c 100644 --- a/docs/AccountCreateRequest.md +++ b/docs/AccountCreateRequest.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EmailAddress** | **string** | The email address which will be associated with the new Account. | -**ClientId** | **string** | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | [optional] -**ClientSecret** | **string** | Used when creating a new account with OAuth authorization.

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | [optional] -**Locale** | **string** | 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] +**EmailAddress** | **string** | The email address which will be associated with the new Account. | **ClientId** | **string** | Used when creating a new account with OAuth authorization.

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

See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) | [optional] **Locale** | **string** | 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] [[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 873ccaf..b7a73e6 100644 --- a/docs/AccountCreateResponse.md +++ b/docs/AccountCreateResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Account** | [**AccountResponse**](AccountResponse.md) | | [optional] -**OauthData** | [**OAuthTokenResponse**](OAuthTokenResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Account** | [**AccountResponse**](AccountResponse.md) | | **OauthData** | [**OAuthTokenResponse**](OAuthTokenResponse.md) | | [optional] **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 ed624a2..1cca9a3 100644 --- a/docs/AccountGetResponse.md +++ b/docs/AccountGetResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Account** | [**AccountResponse**](AccountResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Account** | [**AccountResponse**](AccountResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 b26ddb8..2f96724 100644 --- a/docs/AccountResponse.md +++ b/docs/AccountResponse.md @@ -4,17 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The ID of the Account | [optional] -**EmailAddress** | **string** | The email address associated with the Account. | [optional] -**IsLocked** | **bool** | Returns `true` if the user has been locked out of their account by a team admin. | [optional] -**IsPaidHs** | **bool** | Returns `true` if the user has a paid Dropbox Sign account. | [optional] -**IsPaidHf** | **bool** | Returns `true` if the user has a paid HelloFax account. | [optional] -**Quotas** | [**AccountResponseQuotas**](AccountResponseQuotas.md) | | [optional] -**CallbackUrl** | **string** | The URL that Dropbox Sign events will `POST` to. | [optional] -**RoleCode** | **string** | The membership role for the team. | [optional] -**TeamId** | **string** | The id of the team account belongs to. | [optional] -**Locale** | **string** | 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] -**Usage** | [**AccountResponseUsage**](AccountResponseUsage.md) | | [optional] +**AccountId** | **string** | The ID of the Account | [optional] **EmailAddress** | **string** | The email address associated with the Account. | [optional] **IsLocked** | **bool** | Returns `true` if the user has been locked out of their account by a team admin. | [optional] **IsPaidHs** | **bool** | Returns `true` if the user has a paid Dropbox Sign account. | [optional] **IsPaidHf** | **bool** | Returns `true` if the user has a paid HelloFax account. | [optional] **Quotas** | [**AccountResponseQuotas**](AccountResponseQuotas.md) | | [optional] **CallbackUrl** | **string** | The URL that Dropbox Sign events will `POST` to. | [optional] **RoleCode** | **string** | The membership role for the team. | [optional] **TeamId** | **string** | The id of the team account belongs to. | [optional] **Locale** | **string** | 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] **Usage** | [**AccountResponseUsage**](AccountResponseUsage.md) | | [optional] [[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 fae9d23..2e12ea8 100644 --- a/docs/AccountResponseQuotas.md +++ b/docs/AccountResponseQuotas.md @@ -5,12 +5,7 @@ Details concerning remaining monthly quotas. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ApiSignatureRequestsLeft** | **int?** | API signature requests remaining. | [optional] -**DocumentsLeft** | **int?** | Signature requests remaining. | [optional] -**TemplatesTotal** | **int?** | Total API templates allowed. | [optional] -**TemplatesLeft** | **int?** | API templates remaining. | [optional] -**SmsVerificationsLeft** | **int?** | SMS verifications remaining. | [optional] -**NumFaxPagesLeft** | **int?** | Number of fax pages left | [optional] +**ApiSignatureRequestsLeft** | **int?** | API signature requests remaining. | [optional] **DocumentsLeft** | **int?** | Signature requests remaining. | [optional] **TemplatesTotal** | **int?** | Total API templates allowed. | [optional] **TemplatesLeft** | **int?** | API templates remaining. | [optional] **SmsVerificationsLeft** | **int?** | SMS verifications remaining. | [optional] **NumFaxPagesLeft** | **int?** | Number of fax pages left | [optional] [[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 5ff6c69..32ff208 100644 --- a/docs/AccountUpdateRequest.md +++ b/docs/AccountUpdateRequest.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The ID of the Account | [optional] -**CallbackUrl** | **string** | The URL that Dropbox Sign should POST events to. | [optional] -**Locale** | **string** | 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] +**AccountId** | **string** | The ID of the Account | [optional] **CallbackUrl** | **string** | The URL that Dropbox Sign should POST events to. | [optional] **Locale** | **string** | 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] [[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 070df33..3337b0c 100644 --- a/docs/AccountVerifyResponse.md +++ b/docs/AccountVerifyResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Account** | [**AccountVerifyResponseAccount**](AccountVerifyResponseAccount.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Account** | [**AccountVerifyResponseAccount**](AccountVerifyResponseAccount.md) | | [optional] **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 d395eb7..e587a69 100644 --- a/docs/ApiAppApi.md +++ b/docs/ApiAppApi.md @@ -10,7 +10,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**ApiAppList**](ApiAppApi.md#apiapplist) | **GET** /api_app/list | List API Apps | | [**ApiAppUpdate**](ApiAppApi.md#apiappupdate) | **PUT** /api_app/{client_id} | Update API App | - + # **ApiAppCreate** > ApiAppGetResponse ApiAppCreate (ApiAppCreateRequest apiAppCreateRequest) @@ -130,7 +130,7 @@ catch (ApiException e) [[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) - + # **ApiAppDelete** > void ApiAppDelete (string clientId) @@ -222,7 +222,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) - + # **ApiAppGet** > ApiAppGetResponse ApiAppGet (string clientId) @@ -317,7 +317,7 @@ catch (ApiException e) [[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) - + # **ApiAppList** > ApiAppListResponse ApiAppList (int? page = null, int? pageSize = null) @@ -414,7 +414,7 @@ catch (ApiException e) [[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) - + # **ApiAppUpdate** > ApiAppGetResponse ApiAppUpdate (string clientId, ApiAppUpdateRequest apiAppUpdateRequest) diff --git a/docs/ApiAppCreateRequest.md b/docs/ApiAppCreateRequest.md index 7585b73..00307e7 100644 --- a/docs/ApiAppCreateRequest.md +++ b/docs/ApiAppCreateRequest.md @@ -4,13 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Domains** | **List<string>** | The domain names the ApiApp will be associated with. | -**Name** | **string** | The name you want to assign to the ApiApp. | -**CallbackUrl** | **string** | The URL at which the ApiApp should receive event callbacks. | [optional] -**CustomLogoFile** | **System.IO.Stream** | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | [optional] -**Oauth** | [**SubOAuth**](SubOAuth.md) | | [optional] -**Options** | [**SubOptions**](SubOptions.md) | | [optional] -**WhiteLabelingOptions** | [**SubWhiteLabelingOptions**](SubWhiteLabelingOptions.md) | | [optional] +**Domains** | **List<string>** | The domain names the ApiApp will be associated with. | **Name** | **string** | The name you want to assign to the ApiApp. | **CallbackUrl** | **string** | The URL at which the ApiApp should receive event callbacks. | [optional] **CustomLogoFile** | **System.IO.Stream** | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | [optional] **Oauth** | [**SubOAuth**](SubOAuth.md) | | [optional] **Options** | [**SubOptions**](SubOptions.md) | | [optional] **WhiteLabelingOptions** | [**SubWhiteLabelingOptions**](SubWhiteLabelingOptions.md) | | [optional] [[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 95a2b8b..9677b89 100644 --- a/docs/ApiAppGetResponse.md +++ b/docs/ApiAppGetResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ApiApp** | [**ApiAppResponse**](ApiAppResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**ApiApp** | [**ApiAppResponse**](ApiAppResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 041a0c9..c53c3e4 100644 --- a/docs/ApiAppListResponse.md +++ b/docs/ApiAppListResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ApiApps** | [**List<ApiAppResponse>**](ApiAppResponse.md) | Contains information about API Apps. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**ApiApps** | [**List<ApiAppResponse>**](ApiAppResponse.md) | Contains information about API Apps. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 011ca12..f27ff06 100644 --- a/docs/ApiAppResponse.md +++ b/docs/ApiAppResponse.md @@ -5,16 +5,7 @@ Contains information about an API App. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CallbackUrl** | **string** | The app's callback URL (for events) | [optional] -**ClientId** | **string** | The app's client id | [optional] -**CreatedAt** | **int** | The time that the app was created | [optional] -**Domains** | **List<string>** | The domain name(s) associated with the app | [optional] -**Name** | **string** | The name of the app | [optional] -**IsApproved** | **bool** | Boolean to indicate if the app has been approved | [optional] -**Oauth** | [**ApiAppResponseOAuth**](ApiAppResponseOAuth.md) | | [optional] -**Options** | [**ApiAppResponseOptions**](ApiAppResponseOptions.md) | | [optional] -**OwnerAccount** | [**ApiAppResponseOwnerAccount**](ApiAppResponseOwnerAccount.md) | | [optional] -**WhiteLabelingOptions** | [**ApiAppResponseWhiteLabelingOptions**](ApiAppResponseWhiteLabelingOptions.md) | | [optional] +**CallbackUrl** | **string** | The app's callback URL (for events) | [optional] **ClientId** | **string** | The app's client id | [optional] **CreatedAt** | **int** | The time that the app was created | [optional] **Domains** | **List<string>** | The domain name(s) associated with the app | [optional] **Name** | **string** | The name of the app | [optional] **IsApproved** | **bool** | Boolean to indicate if the app has been approved | [optional] **Oauth** | [**ApiAppResponseOAuth**](ApiAppResponseOAuth.md) | | [optional] **Options** | [**ApiAppResponseOptions**](ApiAppResponseOptions.md) | | [optional] **OwnerAccount** | [**ApiAppResponseOwnerAccount**](ApiAppResponseOwnerAccount.md) | | [optional] **WhiteLabelingOptions** | [**ApiAppResponseWhiteLabelingOptions**](ApiAppResponseWhiteLabelingOptions.md) | | [optional] [[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 b8cdfff..cffe890 100644 --- a/docs/ApiAppResponseOAuth.md +++ b/docs/ApiAppResponseOAuth.md @@ -5,10 +5,7 @@ An object describing the app's OAuth properties, or null if OAuth is not configu Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CallbackUrl** | **string** | The app's OAuth callback URL. | [optional] -**Secret** | **string** | The app's OAuth secret, or null if the app does not belong to user. | [optional] -**Scopes** | **List<string>** | Array of OAuth scopes used by the app. | [optional] -**ChargesUsers** | **bool** | Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. | [optional] +**CallbackUrl** | **string** | The app's OAuth callback URL. | [optional] **Secret** | **string** | The app's OAuth secret, or null if the app does not belong to user. | [optional] **Scopes** | **List<string>** | Array of OAuth scopes used by the app. | [optional] **ChargesUsers** | **bool** | Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. | [optional] [[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 396b83e..eee4afc 100644 --- a/docs/ApiAppResponseOwnerAccount.md +++ b/docs/ApiAppResponseOwnerAccount.md @@ -5,8 +5,7 @@ An object describing the app's owner Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The owner account's ID | [optional] -**EmailAddress** | **string** | The owner account's email address | [optional] +**AccountId** | **string** | The owner account's ID | [optional] **EmailAddress** | **string** | The owner account's email address | [optional] [[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 8d02219..3f3eb34 100644 --- a/docs/ApiAppResponseWhiteLabelingOptions.md +++ b/docs/ApiAppResponseWhiteLabelingOptions.md @@ -5,20 +5,7 @@ An object with options to customize the app's signer page Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**HeaderBackgroundColor** | **string** | | [optional] -**LegalVersion** | **string** | | [optional] -**LinkColor** | **string** | | [optional] -**PageBackgroundColor** | **string** | | [optional] -**PrimaryButtonColor** | **string** | | [optional] -**PrimaryButtonColorHover** | **string** | | [optional] -**PrimaryButtonTextColor** | **string** | | [optional] -**PrimaryButtonTextColorHover** | **string** | | [optional] -**SecondaryButtonColor** | **string** | | [optional] -**SecondaryButtonColorHover** | **string** | | [optional] -**SecondaryButtonTextColor** | **string** | | [optional] -**SecondaryButtonTextColorHover** | **string** | | [optional] -**TextColor1** | **string** | | [optional] -**TextColor2** | **string** | | [optional] +**HeaderBackgroundColor** | **string** | | [optional] **LegalVersion** | **string** | | [optional] **LinkColor** | **string** | | [optional] **PageBackgroundColor** | **string** | | [optional] **PrimaryButtonColor** | **string** | | [optional] **PrimaryButtonColorHover** | **string** | | [optional] **PrimaryButtonTextColor** | **string** | | [optional] **PrimaryButtonTextColorHover** | **string** | | [optional] **SecondaryButtonColor** | **string** | | [optional] **SecondaryButtonColorHover** | **string** | | [optional] **SecondaryButtonTextColor** | **string** | | [optional] **SecondaryButtonTextColorHover** | **string** | | [optional] **TextColor1** | **string** | | [optional] **TextColor2** | **string** | | [optional] [[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 a689255..cd4888a 100644 --- a/docs/ApiAppUpdateRequest.md +++ b/docs/ApiAppUpdateRequest.md @@ -4,13 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CallbackUrl** | **string** | The URL at which the API App should receive event callbacks. | [optional] -**CustomLogoFile** | **System.IO.Stream** | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | [optional] -**Domains** | **List<string>** | The domain names the ApiApp will be associated with. | [optional] -**Name** | **string** | The name you want to assign to the ApiApp. | [optional] -**Oauth** | [**SubOAuth**](SubOAuth.md) | | [optional] -**Options** | [**SubOptions**](SubOptions.md) | | [optional] -**WhiteLabelingOptions** | [**SubWhiteLabelingOptions**](SubWhiteLabelingOptions.md) | | [optional] +**CallbackUrl** | **string** | The URL at which the API App should receive event callbacks. | [optional] **CustomLogoFile** | **System.IO.Stream** | An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) | [optional] **Domains** | **List<string>** | The domain names the ApiApp will be associated with. | [optional] **Name** | **string** | The name you want to assign to the ApiApp. | [optional] **Oauth** | [**SubOAuth**](SubOAuth.md) | | [optional] **Options** | [**SubOptions**](SubOptions.md) | | [optional] **WhiteLabelingOptions** | [**SubWhiteLabelingOptions**](SubWhiteLabelingOptions.md) | | [optional] [[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 25e2c79..050257d 100644 --- a/docs/BulkSendJobApi.md +++ b/docs/BulkSendJobApi.md @@ -7,7 +7,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**BulkSendJobGet**](BulkSendJobApi.md#bulksendjobget) | **GET** /bulk_send_job/{bulk_send_job_id} | Get Bulk Send Job | | [**BulkSendJobList**](BulkSendJobApi.md#bulksendjoblist) | **GET** /bulk_send_job/list | List Bulk Send Jobs | - + # **BulkSendJobGet** > BulkSendJobGetResponse BulkSendJobGet (string bulkSendJobId, int? page = null, int? pageSize = null) @@ -105,7 +105,7 @@ catch (ApiException e) [[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) - + # **BulkSendJobList** > BulkSendJobListResponse BulkSendJobList (int? page = null, int? pageSize = null) diff --git a/docs/BulkSendJobGetResponse.md b/docs/BulkSendJobGetResponse.md index 8f229a1..9d23309 100644 --- a/docs/BulkSendJobGetResponse.md +++ b/docs/BulkSendJobGetResponse.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BulkSendJob** | [**BulkSendJobResponse**](BulkSendJobResponse.md) | | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**SignatureRequests** | [**List<BulkSendJobGetResponseSignatureRequests>**](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**BulkSendJob** | [**BulkSendJobResponse**](BulkSendJobResponse.md) | | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **SignatureRequests** | [**List<BulkSendJobGetResponseSignatureRequests>**](BulkSendJobGetResponseSignatureRequests.md) | Contains information about the Signature Requests sent in bulk. | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 012dd70..779fdaf 100644 --- a/docs/BulkSendJobGetResponseSignatureRequests.md +++ b/docs/BulkSendJobGetResponseSignatureRequests.md @@ -4,31 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TestMode** | **bool?** | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [optional] [default to false] -**SignatureRequestId** | **string** | The id of the SignatureRequest. | [optional] -**RequesterEmailAddress** | **string** | The email address of the initiator of the SignatureRequest. | [optional] -**Title** | **string** | The title the specified Account uses for the SignatureRequest. | [optional] -**OriginalTitle** | **string** | Default Label for account. | [optional] -**Subject** | **string** | The subject in the email that was initially sent to the signers. | [optional] -**Message** | **string** | The custom message in the email that was initially sent to the signers. | [optional] -**Metadata** | **Object** | The metadata attached to the signature request. | [optional] -**CreatedAt** | **int** | Time the signature request was created. | [optional] -**ExpiresAt** | **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] -**IsComplete** | **bool** | Whether or not the SignatureRequest has been fully executed by all signers. | [optional] -**IsDeclined** | **bool** | Whether or not the SignatureRequest has been declined by a signer. | [optional] -**HasError** | **bool** | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | [optional] -**FilesUrl** | **string** | The URL where a copy of the request's documents can be downloaded. | [optional] -**SigningUrl** | **string** | 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] -**DetailsUrl** | **string** | The URL where the requester and the signers can view the current status of the SignatureRequest. | [optional] -**CcEmailAddresses** | **List<string>** | 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] -**SigningRedirectUrl** | **string** | The URL you want the signer redirected to after they successfully sign. | [optional] -**FinalCopyUri** | **string** | The path where the completed document can be downloaded | [optional] -**TemplateIds** | **List<string>** | Templates IDs used in this SignatureRequest (if any). | [optional] -**CustomFields** | [**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` | [optional] -**Attachments** | [**List<SignatureRequestResponseAttachment>**](SignatureRequestResponseAttachment.md) | Signer attachments. | [optional] -**ResponseData** | [**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. | [optional] -**Signatures** | [**List<SignatureRequestResponseSignatures>**](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | [optional] -**BulkSendJobId** | **string** | The id of the BulkSendJob. | [optional] +**TestMode** | **bool?** | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [optional] [default to false]**SignatureRequestId** | **string** | The id of the SignatureRequest. | [optional] **RequesterEmailAddress** | **string** | The email address of the initiator of the SignatureRequest. | [optional] **Title** | **string** | The title the specified Account uses for the SignatureRequest. | [optional] **OriginalTitle** | **string** | Default Label for account. | [optional] **Subject** | **string** | The subject in the email that was initially sent to the signers. | [optional] **Message** | **string** | The custom message in the email that was initially sent to the signers. | [optional] **Metadata** | **Object** | The metadata attached to the signature request. | [optional] **CreatedAt** | **int** | Time the signature request was created. | [optional] **ExpiresAt** | **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] **IsComplete** | **bool** | Whether or not the SignatureRequest has been fully executed by all signers. | [optional] **IsDeclined** | **bool** | Whether or not the SignatureRequest has been declined by a signer. | [optional] **HasError** | **bool** | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | [optional] **FilesUrl** | **string** | The URL where a copy of the request's documents can be downloaded. | [optional] **SigningUrl** | **string** | 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] **DetailsUrl** | **string** | The URL where the requester and the signers can view the current status of the SignatureRequest. | [optional] **CcEmailAddresses** | **List<string>** | 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] **SigningRedirectUrl** | **string** | The URL you want the signer redirected to after they successfully sign. | [optional] **FinalCopyUri** | **string** | The path where the completed document can be downloaded | [optional] **TemplateIds** | **List<string>** | Templates IDs used in this SignatureRequest (if any). | [optional] **CustomFields** | [**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` | [optional] **Attachments** | [**List<SignatureRequestResponseAttachment>**](SignatureRequestResponseAttachment.md) | Signer attachments. | [optional] **ResponseData** | [**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. | [optional] **Signatures** | [**List<SignatureRequestResponseSignatures>**](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | [optional] **BulkSendJobId** | **string** | The id of the BulkSendJob. | [optional] [[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 1ecc64a..0c353dd 100644 --- a/docs/BulkSendJobListResponse.md +++ b/docs/BulkSendJobListResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BulkSendJobs** | [**List<BulkSendJobResponse>**](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**BulkSendJobs** | [**List<BulkSendJobResponse>**](BulkSendJobResponse.md) | Contains a list of BulkSendJobs that the API caller has access to. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 02eff35..6a9e580 100644 --- a/docs/BulkSendJobResponse.md +++ b/docs/BulkSendJobResponse.md @@ -5,10 +5,7 @@ Contains information about the BulkSendJob such as when it was created and how m Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BulkSendJobId** | **string** | The id of the BulkSendJob. | [optional] -**Total** | **int** | The total amount of Signature Requests queued for sending. | [optional] -**IsCreator** | **bool** | True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. | [optional] -**CreatedAt** | **int** | Time that the BulkSendJob was created. | [optional] +**BulkSendJobId** | **string** | The id of the BulkSendJob. | [optional] **Total** | **int** | The total amount of Signature Requests queued for sending. | [optional] **IsCreator** | **bool** | True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. | [optional] **CreatedAt** | **int** | Time that the BulkSendJob was created. | [optional] [[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 dda084a..1649dc4 100644 --- a/docs/BulkSendJobSendResponse.md +++ b/docs/BulkSendJobSendResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BulkSendJob** | [**BulkSendJobResponse**](BulkSendJobResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**BulkSendJob** | [**BulkSendJobResponse**](BulkSendJobResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 9906560..39c38b4 100644 --- a/docs/EmbeddedApi.md +++ b/docs/EmbeddedApi.md @@ -7,7 +7,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**EmbeddedEditUrl**](EmbeddedApi.md#embeddedediturl) | **POST** /embedded/edit_url/{template_id} | Get Embedded Template Edit URL | | [**EmbeddedSignUrl**](EmbeddedApi.md#embeddedsignurl) | **GET** /embedded/sign_url/{signature_id} | Get Embedded Sign URL | - + # **EmbeddedEditUrl** > EmbeddedEditUrlResponse EmbeddedEditUrl (string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest) @@ -109,7 +109,7 @@ catch (ApiException e) [[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) - + # **EmbeddedSignUrl** > EmbeddedSignUrlResponse EmbeddedSignUrl (string signatureId) diff --git a/docs/EmbeddedEditUrlRequest.md b/docs/EmbeddedEditUrlRequest.md index 8ebd954..43b4c3e 100644 --- a/docs/EmbeddedEditUrlRequest.md +++ b/docs/EmbeddedEditUrlRequest.md @@ -4,16 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AllowEditCcs** | **bool** | This allows the requester to enable/disable to add or change CC roles when editing the template. | [optional] [default to false] -**CcRoles** | **List<string>** | 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] -**EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] -**ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false] -**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false] -**MergeFields** | [**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 `[]`. | [optional] -**PreviewOnly** | **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] [default to false] -**ShowPreview** | **bool** | This allows the requester to enable the editor/preview experience. | [optional] [default to false] -**ShowProgressStepper** | **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] [default to true] -**TestMode** | **bool** | Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. | [optional] [default to false] +**AllowEditCcs** | **bool** | This allows the requester to enable/disable to add or change CC roles when editing the template. | [optional] [default to false]**CcRoles** | **List<string>** | 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] **EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] **ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false]**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false]**MergeFields** | [**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 `[]`. | [optional] **PreviewOnly** | **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] [default to false]**ShowPreview** | **bool** | This allows the requester to enable the editor/preview experience. | [optional] [default to false]**ShowProgressStepper** | **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] [default to true]**TestMode** | **bool** | Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. | [optional] [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 c133ac3..d2c1d5f 100644 --- a/docs/EmbeddedEditUrlResponse.md +++ b/docs/EmbeddedEditUrlResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Embedded** | [**EmbeddedEditUrlResponseEmbedded**](EmbeddedEditUrlResponseEmbedded.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Embedded** | [**EmbeddedEditUrlResponseEmbedded**](EmbeddedEditUrlResponseEmbedded.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 92c3336..7750157 100644 --- a/docs/EmbeddedEditUrlResponseEmbedded.md +++ b/docs/EmbeddedEditUrlResponseEmbedded.md @@ -5,8 +5,7 @@ An embedded template object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EditUrl** | **string** | A template url that can be opened in an iFrame. | [optional] -**ExpiresAt** | **int** | The specific time that the the `edit_url` link expires, in epoch. | [optional] +**EditUrl** | **string** | A template url that can be opened in an iFrame. | [optional] **ExpiresAt** | **int** | The specific time that the the `edit_url` link expires, in epoch. | [optional] [[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 95e2673..2bd6732 100644 --- a/docs/EmbeddedSignUrlResponse.md +++ b/docs/EmbeddedSignUrlResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Embedded** | [**EmbeddedSignUrlResponseEmbedded**](EmbeddedSignUrlResponseEmbedded.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Embedded** | [**EmbeddedSignUrlResponseEmbedded**](EmbeddedSignUrlResponseEmbedded.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 1da5d6b..319edfa 100644 --- a/docs/EmbeddedSignUrlResponseEmbedded.md +++ b/docs/EmbeddedSignUrlResponseEmbedded.md @@ -5,8 +5,7 @@ An object that contains necessary information to set up embedded signing. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignUrl** | **string** | A signature url that can be opened in an iFrame. | [optional] -**ExpiresAt** | **int** | The specific time that the the `sign_url` link expires, in epoch. | [optional] +**SignUrl** | **string** | A signature url that can be opened in an iFrame. | [optional] **ExpiresAt** | **int** | The specific time that the the `sign_url` link expires, in epoch. | [optional] [[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 387d682..13dacc1 100644 --- a/docs/ErrorResponseError.md +++ b/docs/ErrorResponseError.md @@ -5,9 +5,7 @@ Contains information about an error that occurred. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ErrorMsg** | **string** | Message describing an error. | -**ErrorName** | **string** | Name of the error. | -**ErrorPath** | **string** | Path at which an error occurred. | [optional] +**ErrorMsg** | **string** | Message describing an error. | **ErrorName** | **string** | Name of the error. | **ErrorPath** | **string** | Path at which an error occurred. | [optional] [[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 8f1e5d7..2ff935c 100644 --- a/docs/EventCallbackRequest.md +++ b/docs/EventCallbackRequest.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Event** | [**EventCallbackRequestEvent**](EventCallbackRequestEvent.md) | | -**Account** | [**AccountResponse**](AccountResponse.md) | | [optional] -**SignatureRequest** | [**SignatureRequestResponse**](SignatureRequestResponse.md) | | [optional] -**Template** | [**TemplateResponse**](TemplateResponse.md) | | [optional] +**Event** | [**EventCallbackRequestEvent**](EventCallbackRequestEvent.md) | | **Account** | [**AccountResponse**](AccountResponse.md) | | [optional] **SignatureRequest** | [**SignatureRequestResponse**](SignatureRequestResponse.md) | | [optional] **Template** | [**TemplateResponse**](TemplateResponse.md) | | [optional] [[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 98884f1..ca1780a 100644 --- a/docs/EventCallbackRequestEvent.md +++ b/docs/EventCallbackRequestEvent.md @@ -5,10 +5,7 @@ Basic information about the event that occurred. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EventTime** | **string** | Time the event was created (using Unix time). | -**EventType** | **string** | Type of callback event that was triggered. | -**EventHash** | **string** | Generated hash used to verify source of event data. | -**EventMetadata** | [**EventCallbackRequestEventMetadata**](EventCallbackRequestEventMetadata.md) | | [optional] +**EventTime** | **string** | Time the event was created (using Unix time). | **EventType** | **string** | Type of callback event that was triggered. | **EventHash** | **string** | Generated hash used to verify source of event data. | **EventMetadata** | [**EventCallbackRequestEventMetadata**](EventCallbackRequestEventMetadata.md) | | [optional] [[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 65ad874..cf78a66 100644 --- a/docs/EventCallbackRequestEventMetadata.md +++ b/docs/EventCallbackRequestEventMetadata.md @@ -5,10 +5,7 @@ Specific metadata about the event. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**RelatedSignatureId** | **string** | Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. | [optional] -**ReportedForAccountId** | **string** | Account ID the event was reported for. | [optional] -**ReportedForAppId** | **string** | App ID the event was reported for. | [optional] -**EventMessage** | **string** | Message about a declined or failed (due to error) signature flow. | [optional] +**RelatedSignatureId** | **string** | Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. | [optional] **ReportedForAccountId** | **string** | Account ID the event was reported for. | [optional] **ReportedForAppId** | **string** | App ID the event was reported for. | [optional] **EventMessage** | **string** | Message about a declined or failed (due to error) signature flow. | [optional] [[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..f89c0de --- /dev/null +++ b/docs/FaxLineAddUserRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineAddUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Number** | **string** | The Fax Line number. | **AccountId** | **string** | Account ID | [optional] **EmailAddress** | **string** | Email address | [optional] + +[[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..4fd57ba --- /dev/null +++ b/docs/FaxLineApi.md @@ -0,0 +1,665 @@ +# Dropbox.Sign.Api.FaxLineApi + +All URIs are relative to *https://api.hellosign.com/v3* + +| Method | HTTP request | Description | +|--------|--------------|-------------| +| [**FaxLineAddUser**](FaxLineApi.md#faxlineadduser) | **PUT** /fax_line/add_user | Add Fax Line User | +| [**FaxLineAreaCodeGet**](FaxLineApi.md#faxlineareacodeget) | **GET** /fax_line/area_codes | Get Available Fax Line Area Codes | +| [**FaxLineCreate**](FaxLineApi.md#faxlinecreate) | **POST** /fax_line/create | Purchase Fax Line | +| [**FaxLineDelete**](FaxLineApi.md#faxlinedelete) | **DELETE** /fax_line | Delete Fax Line | +| [**FaxLineGet**](FaxLineApi.md#faxlineget) | **GET** /fax_line | Get Fax Line | +| [**FaxLineList**](FaxLineApi.md#faxlinelist) | **GET** /fax_line/list | List Fax Lines | +| [**FaxLineRemoveUser**](FaxLineApi.md#faxlineremoveuser) | **PUT** /fax_line/remove_user | Remove Fax Line Access | + + +# **FaxLineAddUser** +> FaxLineResponse FaxLineAddUser (FaxLineAddUserRequest faxLineAddUserRequest) + +Add Fax Line User + +Grants a user access to the specified Fax Line. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + var data = new FaxLineAddUserRequest( + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com" + ); + + try + { + var result = faxLineApi.FaxLineAddUser(data); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the FaxLineAddUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Add Fax Line User + ApiResponse response = apiInstance.FaxLineAddUserWithHttpInfo(faxLineAddUserRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FaxLineApi.FaxLineAddUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxLineAddUserRequest** | [**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) + + +# **FaxLineAreaCodeGet** +> FaxLineAreaCodeGetResponse FaxLineAreaCodeGet (string country, string? state = null, string? province = null, string? city = null) + +Get Available Fax Line Area Codes + +Returns a response with the area codes available for a given state/provice and city. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineAreaCodeGet("US", "CA"); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the FaxLineAreaCodeGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Available Fax Line Area Codes + ApiResponse response = apiInstance.FaxLineAreaCodeGetWithHttpInfo(country, state, province, city); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FaxLineApi.FaxLineAreaCodeGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **country** | **string** | Filter area codes by country. | | +| **state** | **string?** | Filter area codes by state. | [optional] | +| **province** | **string?** | Filter area codes by province. | [optional] | +| **city** | **string?** | 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) + + +# **FaxLineCreate** +> FaxLineResponse FaxLineCreate (FaxLineCreateRequest faxLineCreateRequest) + +Purchase Fax Line + +Purchases a new Fax Line. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + var data = new FaxLineCreateRequest( + areaCode: 209, + country: "US" + ); + + try + { + var result = faxLineApi.FaxLineCreate(data); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the FaxLineCreateWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Purchase Fax Line + ApiResponse response = apiInstance.FaxLineCreateWithHttpInfo(faxLineCreateRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FaxLineApi.FaxLineCreateWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxLineCreateRequest** | [**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) + + +# **FaxLineDelete** +> void FaxLineDelete (FaxLineDeleteRequest faxLineDeleteRequest) + +Delete Fax Line + +Deletes the specified Fax Line from the subscription. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + var data = new FaxLineDeleteRequest( + number: "[FAX_NUMBER]", + ); + + try + { + faxLineApi.FaxLineDelete(data); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the FaxLineDeleteWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Delete Fax Line + apiInstance.FaxLineDeleteWithHttpInfo(faxLineDeleteRequest); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FaxLineApi.FaxLineDeleteWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxLineDeleteRequest** | [**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) + + +# **FaxLineGet** +> FaxLineResponse FaxLineGet (string number) + +Get Fax Line + +Returns the properties and settings of a Fax Line. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineGet("[FAX_NUMBER]"); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the FaxLineGetWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get Fax Line + ApiResponse response = apiInstance.FaxLineGetWithHttpInfo(number); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FaxLineApi.FaxLineGetWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **number** | **string** | 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) + + +# **FaxLineList** +> FaxLineListResponse FaxLineList (string? accountId = null, int? page = null, int? pageSize = null, bool? showTeamLines = null) + +List Fax Lines + +Returns the properties and settings of multiple Fax Lines. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineList(); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the FaxLineListWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // List Fax Lines + ApiResponse response = apiInstance.FaxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FaxLineApi.FaxLineListWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **accountId** | **string?** | Account ID | [optional] | +| **page** | **int?** | Page | [optional] [default to 1] | +| **pageSize** | **int?** | Page size | [optional] [default to 20] | +| **showTeamLines** | **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) + + +# **FaxLineRemoveUser** +> FaxLineResponse FaxLineRemoveUser (FaxLineRemoveUserRequest faxLineRemoveUserRequest) + +Remove Fax Line Access + +Removes a user's access to the specified Fax Line. + +### Example +```csharp +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + var data = new FaxLineRemoveUserRequest( + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com" + ); + + try + { + var result = faxLineApi.FaxLineRemoveUser(data); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} + +``` + +#### Using the FaxLineRemoveUserWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Remove Fax Line Access + ApiResponse response = apiInstance.FaxLineRemoveUserWithHttpInfo(faxLineRemoveUserRequest); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling FaxLineApi.FaxLineRemoveUserWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------|------|-------------|-------| +| **faxLineRemoveUserRequest** | [**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..1bb3e04 --- /dev/null +++ b/docs/FaxLineAreaCodeGetCountryEnum.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.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..7b06480 --- /dev/null +++ b/docs/FaxLineAreaCodeGetProvinceEnum.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.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..91d4723 --- /dev/null +++ b/docs/FaxLineAreaCodeGetResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineAreaCodeGetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AreaCodes** | **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..9519cbc --- /dev/null +++ b/docs/FaxLineAreaCodeGetStateEnum.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.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..21d3ffc --- /dev/null +++ b/docs/FaxLineCreateRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineCreateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AreaCode** | **int** | Area code | **Country** | **string** | Country | **City** | **string** | City | [optional] **AccountId** | **string** | Account ID | [optional] + +[[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..673880d --- /dev/null +++ b/docs/FaxLineDeleteRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineDeleteRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Number** | **string** | 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..95a4918 --- /dev/null +++ b/docs/FaxLineListResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **FaxLines** | [**List<FaxLineResponseFaxLine>**](FaxLineResponseFaxLine.md) | | **Warnings** | [**WarningResponse**](WarningResponse.md) | | [optional] + +[[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..0d73414 --- /dev/null +++ b/docs/FaxLineRemoveUserRequest.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineRemoveUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Number** | **string** | The Fax Line number. | **AccountId** | **string** | Account ID | [optional] **EmailAddress** | **string** | Email address | [optional] + +[[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..101ad06 --- /dev/null +++ b/docs/FaxLineResponse.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FaxLine** | [**FaxLineResponseFaxLine**](FaxLineResponseFaxLine.md) | | **Warnings** | [**WarningResponse**](WarningResponse.md) | | [optional] + +[[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..672e73d --- /dev/null +++ b/docs/FaxLineResponseFaxLine.md @@ -0,0 +1,10 @@ +# Dropbox.Sign.Model.FaxLineResponseFaxLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Number** | **string** | Number | [optional] **CreatedAt** | **int** | Created at | [optional] **UpdatedAt** | **int** | Updated at | [optional] **Accounts** | [**List<AccountResponse>**](AccountResponse.md) | | [optional] + +[[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 3137096..8ce1da0 100644 --- a/docs/FileResponse.md +++ b/docs/FileResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FileUrl** | **string** | URL to the file. | [optional] -**ExpiresAt** | **int** | When the link expires. | [optional] +**FileUrl** | **string** | URL to the file. | **ExpiresAt** | **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 927cb34..784c396 100644 --- a/docs/FileResponseDataUri.md +++ b/docs/FileResponseDataUri.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**DataUri** | **string** | File as base64 encoded string. | [optional] +**DataUri** | **string** | 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 cd1983f..59b6e3a 100644 --- a/docs/ListInfoResponse.md +++ b/docs/ListInfoResponse.md @@ -5,10 +5,7 @@ Contains pagination information about the data returned. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NumPages** | **int** | Total number of pages available. | [optional] -**NumResults** | **int?** | Total number of objects available. | [optional] -**Page** | **int** | Number of the page being returned. | [optional] -**PageSize** | **int** | Objects returned per page. | [optional] +**NumPages** | **int** | Total number of pages available. | [optional] **NumResults** | **int?** | Total number of objects available. | [optional] **Page** | **int** | Number of the page being returned. | [optional] **PageSize** | **int** | Objects returned per page. | [optional] [[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 bde8c1a..5af9123 100644 --- a/docs/OAuthApi.md +++ b/docs/OAuthApi.md @@ -7,7 +7,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**OauthTokenGenerate**](OAuthApi.md#oauthtokengenerate) | **POST** /oauth/token | OAuth Token Generate | | [**OauthTokenRefresh**](OAuthApi.md#oauthtokenrefresh) | **POST** /oauth/token?refresh | OAuth Token Refresh | - + # **OauthTokenGenerate** > OAuthTokenResponse OauthTokenGenerate (OAuthTokenGenerateRequest oAuthTokenGenerateRequest) @@ -102,7 +102,7 @@ No authorization required [[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) - + # **OauthTokenRefresh** > OAuthTokenResponse OauthTokenRefresh (OAuthTokenRefreshRequest oAuthTokenRefreshRequest) diff --git a/docs/OAuthTokenGenerateRequest.md b/docs/OAuthTokenGenerateRequest.md index 0513db7..04b69bc 100644 --- a/docs/OAuthTokenGenerateRequest.md +++ b/docs/OAuthTokenGenerateRequest.md @@ -4,11 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | The client id of the app requesting authorization. | -**ClientSecret** | **string** | The secret token of your app. | -**Code** | **string** | The code passed to your callback when the user granted access. | -**GrantType** | **string** | When generating a new token use `authorization_code`. | [default to "authorization_code"] -**State** | **string** | Same as the state you specified earlier. | +**ClientId** | **string** | The client id of the app requesting authorization. | **ClientSecret** | **string** | The secret token of your app. | **Code** | **string** | The code passed to your callback when the user granted access. | **GrantType** | **string** | When generating a new token use `authorization_code`. | [default to "authorization_code"]**State** | **string** | 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 02ff118..c9866d3 100644 --- a/docs/OAuthTokenRefreshRequest.md +++ b/docs/OAuthTokenRefreshRequest.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**GrantType** | **string** | When refreshing an existing token use `refresh_token`. | [default to "refresh_token"] -**RefreshToken** | **string** | The token provided when you got the expired access token. | +**GrantType** | **string** | When refreshing an existing token use `refresh_token`. | [default to "refresh_token"]**RefreshToken** | **string** | 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 ea11e01..52a0501 100644 --- a/docs/OAuthTokenResponse.md +++ b/docs/OAuthTokenResponse.md @@ -4,11 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccessToken** | **string** | | [optional] -**TokenType** | **string** | | [optional] -**RefreshToken** | **string** | | [optional] -**ExpiresIn** | **int** | Number of seconds until the `access_token` expires. Uses epoch time. | [optional] -**State** | **string** | | [optional] +**AccessToken** | **string** | | [optional] **TokenType** | **string** | | [optional] **RefreshToken** | **string** | | [optional] **ExpiresIn** | **int** | Number of seconds until the `access_token` expires. Uses epoch time. | [optional] **State** | **string** | | [optional] [[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 7069375..9ea9879 100644 --- a/docs/ReportApi.md +++ b/docs/ReportApi.md @@ -6,7 +6,7 @@ All URIs are relative to *https://api.hellosign.com/v3* |--------|--------------|-------------| | [**ReportCreate**](ReportApi.md#reportcreate) | **POST** /report/create | Create Report | - + # **ReportCreate** > ReportCreateResponse ReportCreate (ReportCreateRequest reportCreateRequest) diff --git a/docs/ReportCreateRequest.md b/docs/ReportCreateRequest.md index d1c813d..4b02527 100644 --- a/docs/ReportCreateRequest.md +++ b/docs/ReportCreateRequest.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EndDate** | **string** | The (inclusive) end date for the report data in `MM/DD/YYYY` format. | -**ReportType** | **List<string>** | 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). | -**StartDate** | **string** | The (inclusive) start date for the report data in `MM/DD/YYYY` format. | +**EndDate** | **string** | The (inclusive) end date for the report data in `MM/DD/YYYY` format. | **ReportType** | **List<ReportCreateRequest.ReportTypeEnum>** | 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). | **StartDate** | **string** | 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 18102c6..a6416fe 100644 --- a/docs/ReportCreateResponse.md +++ b/docs/ReportCreateResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Report** | [**ReportResponse**](ReportResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Report** | [**ReportResponse**](ReportResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 fd15b48..9f6aec6 100644 --- a/docs/ReportResponse.md +++ b/docs/ReportResponse.md @@ -5,10 +5,7 @@ Contains information about the report request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Success** | **string** | A message indicating the requested operation's success | [optional] -**StartDate** | **string** | The (inclusive) start date for the report data in MM/DD/YYYY format. | [optional] -**EndDate** | **string** | The (inclusive) end date for the report data in MM/DD/YYYY format. | [optional] -**ReportType** | **List<string>** | 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] +**Success** | **string** | A message indicating the requested operation's success | [optional] **StartDate** | **string** | The (inclusive) start date for the report data in MM/DD/YYYY format. | [optional] **EndDate** | **string** | The (inclusive) end date for the report data in MM/DD/YYYY format. | [optional] **ReportType** | **List<ReportResponse.ReportTypeEnum>** | 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] [[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 60f6e1b..c411d0c 100644 --- a/docs/SignatureRequestApi.md +++ b/docs/SignatureRequestApi.md @@ -21,7 +21,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**SignatureRequestSendWithTemplate**](SignatureRequestApi.md#signaturerequestsendwithtemplate) | **POST** /signature_request/send_with_template | Send with Template | | [**SignatureRequestUpdate**](SignatureRequestApi.md#signaturerequestupdate) | **POST** /signature_request/update/{signature_request_id} | Update Signature Request | - + # **SignatureRequestBulkCreateEmbeddedWithTemplate** > BulkSendJobSendResponse SignatureRequestBulkCreateEmbeddedWithTemplate (SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest) @@ -164,7 +164,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestBulkSendWithTemplate** > BulkSendJobSendResponse SignatureRequestBulkSendWithTemplate (SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest) @@ -306,7 +306,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestCancel** > void SignatureRequestCancel (string signatureRequestId) @@ -398,7 +398,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) - + # **SignatureRequestCreateEmbedded** > SignatureRequestGetResponse SignatureRequestCreateEmbedded (SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest) @@ -533,7 +533,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestCreateEmbeddedWithTemplate** > SignatureRequestGetResponse SignatureRequestCreateEmbeddedWithTemplate (SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest) @@ -649,7 +649,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestFiles** > System.IO.Stream SignatureRequestFiles (string signatureRequestId, string? fileType = null) @@ -749,7 +749,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestFilesAsDataUri** > FileResponseDataUri SignatureRequestFilesAsDataUri (string signatureRequestId) @@ -844,7 +844,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestFilesAsFileUrl** > FileResponse SignatureRequestFilesAsFileUrl (string signatureRequestId, int? forceDownload = null) @@ -940,7 +940,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestGet** > SignatureRequestGetResponse SignatureRequestGet (string signatureRequestId) @@ -1035,7 +1035,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestList** > SignatureRequestListResponse SignatureRequestList (string? accountId = null, int? page = null, int? pageSize = null, string? query = null) @@ -1133,7 +1133,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestReleaseHold** > SignatureRequestGetResponse SignatureRequestReleaseHold (string signatureRequestId) @@ -1228,7 +1228,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestRemind** > SignatureRequestGetResponse SignatureRequestRemind (string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest) @@ -1328,7 +1328,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestRemove** > void SignatureRequestRemove (string signatureRequestId) @@ -1419,7 +1419,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) - + # **SignatureRequestSend** > SignatureRequestGetResponse SignatureRequestSend (SignatureRequestSendRequest signatureRequestSendRequest) @@ -1565,7 +1565,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestSendWithTemplate** > SignatureRequestGetResponse SignatureRequestSendWithTemplate (SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest) @@ -1695,7 +1695,7 @@ catch (ApiException e) [[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) - + # **SignatureRequestUpdate** > SignatureRequestGetResponse SignatureRequestUpdate (string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest) diff --git a/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md b/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md index 7feccc8..002d950 100644 --- a/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md +++ b/docs/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.md @@ -4,19 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | -**ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | -**SignerFile** | **System.IO.Stream** | `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] -**SignerList** | [**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. | [optional] -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] -**CustomFields** | [**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. | [optional] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, 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. | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **SignerFile** | **System.IO.Stream** | `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] **SignerList** | [**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. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **CustomFields** | [**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. | [optional] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, 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. | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] [[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 8eb63a7..8e10821 100644 --- a/docs/SignatureRequestBulkSendWithTemplateRequest.md +++ b/docs/SignatureRequestBulkSendWithTemplateRequest.md @@ -4,19 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | -**SignerFile** | **System.IO.Stream** | `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] -**SignerList** | [**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. | [optional] -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] -**ClientId** | **string** | 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] -**CustomFields** | [**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. | [optional] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, 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. | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **SignerFile** | **System.IO.Stream** | `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] **SignerList** | [**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. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **ClientId** | **string** | 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] **CustomFields** | [**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. | [optional] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, 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. | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] [[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 20d996c..babeb4e 100644 --- a/docs/SignatureRequestCreateEmbeddedRequest.md +++ b/docs/SignatureRequestCreateEmbeddedRequest.md @@ -4,30 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**FileUrls** | **List<string>** | 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] -**Signers** | [**List<SubSignatureRequestSigner>**](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

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

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**AllowReassign** | **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] [default to false] -**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] -**CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] -**CustomFields** | [**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. | [optional] -**FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] -**FormFieldGroups** | [**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`. | [optional] -**FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] -**FormFieldsPerDocument** | [**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` | [optional] -**HideTextTags** | **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] [default to false] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, 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. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] -**UseTextTags** | **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] [default to false] -**PopulateAutoFillFields** | **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] [default to false] -**ExpiresAt** | **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. | [optional] +**ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | 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] **Signers** | [**List<SubSignatureRequestSigner>**](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

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

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**AllowReassign** | **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] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] **CustomFields** | [**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. | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **FormFieldGroups** | [**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`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **FormFieldsPerDocument** | [**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` | [optional] **HideTextTags** | **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] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, 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. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **UseTextTags** | **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] [default to false]**PopulateAutoFillFields** | **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] [default to false]**ExpiresAt** | **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. | [optional] [[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 20a3531..61bab9b 100644 --- a/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md +++ b/docs/SignatureRequestCreateEmbeddedWithTemplateRequest.md @@ -4,21 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | -**ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | -**Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] -**CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**FileUrls** | **List<string>** | 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] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, 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. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] -**PopulateAutoFillFields** | **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] [default to false] +**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. | **ClientId** | **string** | Client id of the app you're using to create this embedded signature request. Used for security purposes. | **Signers** | [**List<SubSignatureRequestTemplateSigner>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | 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] **Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, 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. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **PopulateAutoFillFields** | **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] [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 6f985fc..b43aebe 100644 --- a/docs/SignatureRequestGetResponse.md +++ b/docs/SignatureRequestGetResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignatureRequest** | [**SignatureRequestResponse**](SignatureRequestResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**SignatureRequest** | [**SignatureRequestResponse**](SignatureRequestResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 41c1429..d3cda99 100644 --- a/docs/SignatureRequestListResponse.md +++ b/docs/SignatureRequestListResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignatureRequests** | [**List<SignatureRequestResponse>**](SignatureRequestResponse.md) | Contains information about signature requests. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**SignatureRequests** | [**List<SignatureRequestResponse>**](SignatureRequestResponse.md) | Contains information about signature requests. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 60f2bfa..45ab25c 100644 --- a/docs/SignatureRequestRemindRequest.md +++ b/docs/SignatureRequestRemindRequest.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EmailAddress** | **string** | The email address of the signer to send a reminder to. | -**Name** | **string** | The name of the signer to send a reminder to. Include if two or more signers share an email address. | [optional] +**EmailAddress** | **string** | The email address of the signer to send a reminder to. | **Name** | **string** | The name of the signer to send a reminder to. Include if two or more signers share an email address. | [optional] [[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 3a36fd4..a21e1fd 100644 --- a/docs/SignatureRequestResponse.md +++ b/docs/SignatureRequestResponse.md @@ -5,31 +5,7 @@ Contains information about a signature request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TestMode** | **bool?** | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [optional] [default to false] -**SignatureRequestId** | **string** | The id of the SignatureRequest. | [optional] -**RequesterEmailAddress** | **string** | The email address of the initiator of the SignatureRequest. | [optional] -**Title** | **string** | The title the specified Account uses for the SignatureRequest. | [optional] -**OriginalTitle** | **string** | Default Label for account. | [optional] -**Subject** | **string** | The subject in the email that was initially sent to the signers. | [optional] -**Message** | **string** | The custom message in the email that was initially sent to the signers. | [optional] -**Metadata** | **Object** | The metadata attached to the signature request. | [optional] -**CreatedAt** | **int** | Time the signature request was created. | [optional] -**ExpiresAt** | **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] -**IsComplete** | **bool** | Whether or not the SignatureRequest has been fully executed by all signers. | [optional] -**IsDeclined** | **bool** | Whether or not the SignatureRequest has been declined by a signer. | [optional] -**HasError** | **bool** | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | [optional] -**FilesUrl** | **string** | The URL where a copy of the request's documents can be downloaded. | [optional] -**SigningUrl** | **string** | 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] -**DetailsUrl** | **string** | The URL where the requester and the signers can view the current status of the SignatureRequest. | [optional] -**CcEmailAddresses** | **List<string>** | 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] -**SigningRedirectUrl** | **string** | The URL you want the signer redirected to after they successfully sign. | [optional] -**FinalCopyUri** | **string** | The path where the completed document can be downloaded | [optional] -**TemplateIds** | **List<string>** | Templates IDs used in this SignatureRequest (if any). | [optional] -**CustomFields** | [**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` | [optional] -**Attachments** | [**List<SignatureRequestResponseAttachment>**](SignatureRequestResponseAttachment.md) | Signer attachments. | [optional] -**ResponseData** | [**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. | [optional] -**Signatures** | [**List<SignatureRequestResponseSignatures>**](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | [optional] -**BulkSendJobId** | **string** | The ID of the Bulk Send job which sent the signature request, if applicable. | [optional] +**TestMode** | **bool?** | Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. | [optional] [default to false]**SignatureRequestId** | **string** | The id of the SignatureRequest. | [optional] **RequesterEmailAddress** | **string** | The email address of the initiator of the SignatureRequest. | [optional] **Title** | **string** | The title the specified Account uses for the SignatureRequest. | [optional] **OriginalTitle** | **string** | Default Label for account. | [optional] **Subject** | **string** | The subject in the email that was initially sent to the signers. | [optional] **Message** | **string** | The custom message in the email that was initially sent to the signers. | [optional] **Metadata** | **Object** | The metadata attached to the signature request. | [optional] **CreatedAt** | **int** | Time the signature request was created. | [optional] **ExpiresAt** | **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] **IsComplete** | **bool** | Whether or not the SignatureRequest has been fully executed by all signers. | [optional] **IsDeclined** | **bool** | Whether or not the SignatureRequest has been declined by a signer. | [optional] **HasError** | **bool** | Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). | [optional] **FilesUrl** | **string** | The URL where a copy of the request's documents can be downloaded. | [optional] **SigningUrl** | **string** | 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] **DetailsUrl** | **string** | The URL where the requester and the signers can view the current status of the SignatureRequest. | [optional] **CcEmailAddresses** | **List<string>** | 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] **SigningRedirectUrl** | **string** | The URL you want the signer redirected to after they successfully sign. | [optional] **FinalCopyUri** | **string** | The path where the completed document can be downloaded | [optional] **TemplateIds** | **List<string>** | Templates IDs used in this SignatureRequest (if any). | [optional] **CustomFields** | [**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` | [optional] **Attachments** | [**List<SignatureRequestResponseAttachment>**](SignatureRequestResponseAttachment.md) | Signer attachments. | [optional] **ResponseData** | [**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. | [optional] **Signatures** | [**List<SignatureRequestResponseSignatures>**](SignatureRequestResponseSignatures.md) | An array of signature objects, 1 for each signer. | [optional] **BulkSendJobId** | **string** | The ID of the Bulk Send job which sent the signature request, if applicable. | [optional] [[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 0d488c9..cf09569 100644 --- a/docs/SignatureRequestResponseAttachment.md +++ b/docs/SignatureRequestResponseAttachment.md @@ -5,12 +5,7 @@ Signer attachments. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | The unique ID for this attachment. | -**Signer** | **string** | The Signer this attachment is assigned to. | -**Name** | **string** | The name of this attachment. | -**Required** | **bool** | A boolean value denoting if this attachment is required. | -**Instructions** | **string** | Instructions for Signer. | [optional] -**UploadedAt** | **int?** | Timestamp when attachment was uploaded by Signer. | [optional] +**Id** | **string** | The unique ID for this attachment. | **Signer** | **string** | The Signer this attachment is assigned to. | **Name** | **string** | The name of this attachment. | **Required** | **bool** | A boolean value denoting if this attachment is required. | **Instructions** | **string** | Instructions for Signer. | [optional] **UploadedAt** | **int?** | Timestamp when attachment was uploaded by Signer. | [optional] [[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 cb06159..02072d8 100644 --- a/docs/SignatureRequestResponseCustomFieldBase.md +++ b/docs/SignatureRequestResponseCustomFieldBase.md @@ -5,11 +5,7 @@ An array of Custom Field objects containing the name and type of each custom fie Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | -**Name** | **string** | The name of the Custom Field. | -**Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**ApiId** | **string** | The unique ID for this field. | [optional] -**Editor** | **string** | The name of the Role that is able to edit this field. | [optional] +**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | **Name** | **string** | The name of the Custom Field. | **Required** | **bool** | A boolean value denoting if this field is required. | [optional] **ApiId** | **string** | The unique ID for this field. | [optional] **Editor** | **string** | The name of the Role that is able to edit this field. | [optional] [[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 7ec0fea..42a1a30 100644 --- a/docs/SignatureRequestResponseCustomFieldCheckbox.md +++ b/docs/SignatureRequestResponseCustomFieldCheckbox.md @@ -9,8 +9,7 @@ Name | Type | Description | Notes **Required** | **bool** | A boolean value denoting if this field is required. | [optional] **ApiId** | **string** | The unique ID for this field. | [optional] **Editor** | **string** | The name of the Role that is able to edit this field. | [optional] -**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "checkbox"] -**Value** | **bool** | A true/false for checkbox fields | [optional] +**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "checkbox"]**Value** | **bool** | A true/false for checkbox fields | [optional] [[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 505b9ed..c3c9ca8 100644 --- a/docs/SignatureRequestResponseCustomFieldText.md +++ b/docs/SignatureRequestResponseCustomFieldText.md @@ -9,8 +9,7 @@ Name | Type | Description | Notes **Required** | **bool** | A boolean value denoting if this field is required. | [optional] **ApiId** | **string** | The unique ID for this field. | [optional] **Editor** | **string** | The name of the Role that is able to edit this field. | [optional] -**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "text"] -**Value** | **string** | A text string for text fields | [optional] +**Type** | **string** | The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. | [default to "text"]**Value** | **string** | A text string for text fields | [optional] [[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 fdc3545..d425f40 100644 --- a/docs/SignatureRequestResponseCustomFieldTypeEnum.md +++ b/docs/SignatureRequestResponseCustomFieldTypeEnum.md @@ -5,5 +5,6 @@ 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 8adfadb..63c965d 100644 --- a/docs/SignatureRequestResponseDataBase.md +++ b/docs/SignatureRequestResponseDataBase.md @@ -5,11 +5,7 @@ An array of form field objects containing the name, value, and type of each text Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ApiId** | **string** | The unique ID for this field. | [optional] -**SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] -**Name** | **string** | The name of the form field. | [optional] -**Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | | [optional] +**ApiId** | **string** | The unique ID for this field. | [optional] **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] **Type** | **string** | | [optional] [[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 f0c37a9..493db1e 100644 --- a/docs/SignatureRequestResponseDataTypeEnum.md +++ b/docs/SignatureRequestResponseDataTypeEnum.md @@ -5,5 +5,6 @@ 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 4166044..57d02ae 100644 --- a/docs/SignatureRequestResponseDataValueCheckbox.md +++ b/docs/SignatureRequestResponseDataValueCheckbox.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A yes/no checkbox | [optional] [default to "checkbox"] -**Value** | **bool** | The value of the form field. | [optional] +**Type** | **string** | A yes/no checkbox | [optional] [default to "checkbox"]**Value** | **bool** | The value of the form field. | [optional] [[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 bad93e4..7e96757 100644 --- a/docs/SignatureRequestResponseDataValueCheckboxMerge.md +++ b/docs/SignatureRequestResponseDataValueCheckboxMerge.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A checkbox field that has default value set by the api | [optional] [default to "checkbox-merge"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | A checkbox field that has default value set by the api | [optional] [default to "checkbox-merge"]**Value** | **string** | The value of the form field. | [optional] [[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 bb08382..3bc2e55 100644 --- a/docs/SignatureRequestResponseDataValueDateSigned.md +++ b/docs/SignatureRequestResponseDataValueDateSigned.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A date | [optional] [default to "date_signed"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | A date | [optional] [default to "date_signed"]**Value** | **string** | The value of the form field. | [optional] [[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 bfcdf07..13473c2 100644 --- a/docs/SignatureRequestResponseDataValueDropdown.md +++ b/docs/SignatureRequestResponseDataValueDropdown.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | An input field for dropdowns | [optional] [default to "dropdown"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | An input field for dropdowns | [optional] [default to "dropdown"]**Value** | **string** | The value of the form field. | [optional] [[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 389f139..fcd9ab1 100644 --- a/docs/SignatureRequestResponseDataValueInitials.md +++ b/docs/SignatureRequestResponseDataValueInitials.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | An input field for initials | [optional] [default to "initials"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | An input field for initials | [optional] [default to "initials"]**Value** | **string** | The value of the form field. | [optional] [[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 3dc5693..ccc7520 100644 --- a/docs/SignatureRequestResponseDataValueRadio.md +++ b/docs/SignatureRequestResponseDataValueRadio.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | An input field for radios | [optional] [default to "radio"] -**Value** | **bool** | The value of the form field. | [optional] +**Type** | **string** | An input field for radios | [optional] [default to "radio"]**Value** | **bool** | The value of the form field. | [optional] [[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 8ea7c7c..2ee12dc 100644 --- a/docs/SignatureRequestResponseDataValueSignature.md +++ b/docs/SignatureRequestResponseDataValueSignature.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A signature input field | [optional] [default to "signature"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | A signature input field | [optional] [default to "signature"]**Value** | **string** | The value of the form field. | [optional] [[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 e8c2438..14e685e 100644 --- a/docs/SignatureRequestResponseDataValueText.md +++ b/docs/SignatureRequestResponseDataValueText.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A text input field | [optional] [default to "text"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | A text input field | [optional] [default to "text"]**Value** | **string** | The value of the form field. | [optional] [[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 d41148e..2c8ab32 100644 --- a/docs/SignatureRequestResponseDataValueTextMerge.md +++ b/docs/SignatureRequestResponseDataValueTextMerge.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **SignatureId** | **string** | The ID of the signature to which this response is linked. | [optional] **Name** | **string** | The name of the form field. | [optional] **Required** | **bool** | A boolean value denoting if this field is required. | [optional] -**Type** | **string** | A text field that has default text set by the api | [optional] [default to "text-merge"] -**Value** | **string** | The value of the form field. | [optional] +**Type** | **string** | A text field that has default text set by the api | [optional] [default to "text-merge"]**Value** | **string** | The value of the form field. | [optional] [[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 484840e..0956244 100644 --- a/docs/SignatureRequestResponseSignatures.md +++ b/docs/SignatureRequestResponseSignatures.md @@ -5,25 +5,7 @@ An array of signature objects, 1 for each signer. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignatureId** | **string** | Signature identifier. | [optional] -**SignerGroupGuid** | **string** | Signer Group GUID | [optional] -**SignerEmailAddress** | **string** | The email address of the signer. | [optional] -**SignerName** | **string** | The name of the signer. | [optional] -**SignerRole** | **string** | The role of the signer. | [optional] -**Order** | **int?** | If signer order is assigned this is the 0-based index for this signer. | [optional] -**StatusCode** | **string** | The current status of the signature. eg: awaiting_signature, signed, declined. | [optional] -**DeclineReason** | **string** | The reason provided by the signer for declining the request. | [optional] -**SignedAt** | **int?** | Time that the document was signed or null. | [optional] -**LastViewedAt** | **int?** | The time that the document was last viewed by this signer or null. | [optional] -**LastRemindedAt** | **int?** | The time the last reminder email was sent to the signer or null. | [optional] -**HasPin** | **bool** | Boolean to indicate whether this signature requires a PIN to access. | [optional] -**HasSmsAuth** | **bool?** | Boolean to indicate whether this signature has SMS authentication enabled. | [optional] -**HasSmsDelivery** | **bool?** | Boolean to indicate whether this signature has SMS delivery enabled. | [optional] -**SmsPhoneNumber** | **string** | The SMS phone number used for authentication or signature request delivery. | [optional] -**ReassignedBy** | **string** | Email address of original signer who reassigned to this signer. | [optional] -**ReassignmentReason** | **string** | Reason provided by original signer who reassigned to this signer. | [optional] -**ReassignedFrom** | **string** | Previous signature identifier. | [optional] -**Error** | **string** | Error message pertaining to this signer, or null. | [optional] +**SignatureId** | **string** | Signature identifier. | [optional] **SignerGroupGuid** | **string** | Signer Group GUID | [optional] **SignerEmailAddress** | **string** | The email address of the signer. | [optional] **SignerName** | **string** | The name of the signer. | [optional] **SignerRole** | **string** | The role of the signer. | [optional] **Order** | **int?** | If signer order is assigned this is the 0-based index for this signer. | [optional] **StatusCode** | **string** | The current status of the signature. eg: awaiting_signature, signed, declined. | [optional] **DeclineReason** | **string** | The reason provided by the signer for declining the request. | [optional] **SignedAt** | **int?** | Time that the document was signed or null. | [optional] **LastViewedAt** | **int?** | The time that the document was last viewed by this signer or null. | [optional] **LastRemindedAt** | **int?** | The time the last reminder email was sent to the signer or null. | [optional] **HasPin** | **bool** | Boolean to indicate whether this signature requires a PIN to access. | [optional] **HasSmsAuth** | **bool?** | Boolean to indicate whether this signature has SMS authentication enabled. | [optional] **HasSmsDelivery** | **bool?** | Boolean to indicate whether this signature has SMS delivery enabled. | [optional] **SmsPhoneNumber** | **string** | The SMS phone number used for authentication or signature request delivery. | [optional] **ReassignedBy** | **string** | Email address of original signer who reassigned to this signer. | [optional] **ReassignmentReason** | **string** | Reason provided by original signer who reassigned to this signer. | [optional] **ReassignedFrom** | **string** | Previous signature identifier. | [optional] **Error** | **string** | Error message pertaining to this signer, or null. | [optional] [[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 545f976..000c7ad 100644 --- a/docs/SignatureRequestSendRequest.md +++ b/docs/SignatureRequestSendRequest.md @@ -4,32 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**FileUrls** | **List<string>** | 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] -**Signers** | [**List<SubSignatureRequestSigner>**](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

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

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**AllowReassign** | **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] [default to false] -**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] -**CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] -**ClientId** | **string** | 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] -**CustomFields** | [**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. | [optional] -**FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] -**FormFieldGroups** | [**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`. | [optional] -**FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] -**FormFieldsPerDocument** | [**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` | [optional] -**HideTextTags** | **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] [default to false] -**IsQualifiedSignature** | **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. | [optional] [default to false] -**IsEid** | **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. | [optional] [default to false] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, 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. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] -**UseTextTags** | **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] [default to false] -**ExpiresAt** | **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. | [optional] +**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | 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] **Signers** | [**List<SubSignatureRequestSigner>**](SubSignatureRequestSigner.md) | Add Signers to your Signature Request.

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

This endpoint requires either **signers** or **grouped_signers**, but not both. | [optional] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**AllowReassign** | **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] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] **ClientId** | **string** | 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] **CustomFields** | [**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. | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **FormFieldGroups** | [**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`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **FormFieldsPerDocument** | [**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` | [optional] **HideTextTags** | **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] [default to false]**IsQualifiedSignature** | **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. | [optional] [default to false]**IsEid** | **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. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, 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. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **UseTextTags** | **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] [default to false]**ExpiresAt** | **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. | [optional] [[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 e77a9a1..12fc09b 100644 --- a/docs/SignatureRequestSendWithTemplateRequest.md +++ b/docs/SignatureRequestSendWithTemplateRequest.md @@ -4,23 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateIds** | **List<string>** | 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>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] -**ClientId** | **string** | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | [optional] -**CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**FileUrls** | **List<string>** | 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] -**IsQualifiedSignature** | **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. | [optional] [default to false] -**IsEid** | **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. | [optional] [default to false] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, 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. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] +**TemplateIds** | **List<string>** | 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>**](SubSignatureRequestTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **ClientId** | **string** | Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | 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] **IsQualifiedSignature** | **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. | [optional] [default to false]**IsEid** | **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. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, 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. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **bool** | Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. | [optional] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] [[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 7aa6991..9f19a93 100644 --- a/docs/SignatureRequestUpdateRequest.md +++ b/docs/SignatureRequestUpdateRequest.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignatureId** | **string** | The signature ID for the recipient. | -**EmailAddress** | **string** | The new email address for the recipient.

This will generate a new `signature_id` value.

**NOTE:** Optional if `name` is provided. | [optional] -**Name** | **string** | The new name for the recipient.

**NOTE:** Optional if `email_address` is provided. | [optional] -**ExpiresAt** | **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. | [optional] +**SignatureId** | **string** | The signature ID for the recipient. | **EmailAddress** | **string** | The new email address for the recipient.

This will generate a new `signature_id` value.

**NOTE:** Optional if `name` is provided. | [optional] **Name** | **string** | The new name for the recipient.

**NOTE:** Optional if `email_address` is provided. | [optional] **ExpiresAt** | **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. | [optional] [[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 80d4f5c..55eb99a 100644 --- a/docs/SubAttachment.md +++ b/docs/SubAttachment.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of attachment. | -**SignerIndex** | **int** | The signer's index in the `signers` parameter (0-based indexing).

**NOTE:** Only one signer can be assigned per attachment. | -**Instructions** | **string** | The instructions for uploading the attachment. | [optional] -**Required** | **bool** | Determines if the attachment must be uploaded. | [optional] [default to false] +**Name** | **string** | The name of attachment. | **SignerIndex** | **int** | The signer's index in the `signers` parameter (0-based indexing).

**NOTE:** Only one signer can be assigned per attachment. | **Instructions** | **string** | The instructions for uploading the attachment. | [optional] **Required** | **bool** | Determines if the attachment must be uploaded. | [optional] [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 69b43a9..c256792 100644 --- a/docs/SubBulkSignerList.md +++ b/docs/SubBulkSignerList.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CustomFields** | [**List<SubBulkSignerListCustomField>**](SubBulkSignerListCustomField.md) | An array of custom field values. | [optional] -**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. | [optional] +**CustomFields** | [**List<SubBulkSignerListCustomField>**](SubBulkSignerListCustomField.md) | An array of custom field values. | [optional] **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. | [optional] [[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 1646ba4..da30ceb 100644 --- a/docs/SubBulkSignerListCustomField.md +++ b/docs/SubBulkSignerListCustomField.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the custom field. Must be the field's `name` or `api_id`. | -**Value** | **string** | The value of the custom field. | +**Name** | **string** | The name of the custom field. Must be the field's `name` or `api_id`. | **Value** | **string** | 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 bfe6bc5..098eee5 100644 --- a/docs/SubCC.md +++ b/docs/SubCC.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Role** | **string** | Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. | -**EmailAddress** | **string** | The email address of the CC recipient. | +**Role** | **string** | Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. | **EmailAddress** | **string** | 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 27ee651..0ef9221 100644 --- a/docs/SubCustomField.md +++ b/docs/SubCustomField.md @@ -5,10 +5,7 @@ When used together with merge fields, `custom_fields` allows users to add pre-fi Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | 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** | **string** | 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] -**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] [default to false] -**Value** | **string** | The string that resolves (aka "pre-fills") to the merge field on the final document(s) used for signing. | [optional] +**Name** | **string** | 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** | **string** | 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] **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] [default to false]**Value** | **string** | The string that resolves (aka "pre-fills") to the merge field on the final document(s) used for signing. | [optional] [[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 b1bca0a..e0b22f1 100644 --- a/docs/SubEditorOptions.md +++ b/docs/SubEditorOptions.md @@ -5,8 +5,7 @@ This allows the requester to specify editor options when a preparing a document Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AllowEditSigners** | **bool** | Allows requesters to edit the list of signers | [optional] [default to false] -**AllowEditDocuments** | **bool** | Allows requesters to edit documents, including delete and add | [optional] [default to false] +**AllowEditSigners** | **bool** | Allows requesters to edit the list of signers | [optional] [default to false]**AllowEditDocuments** | **bool** | Allows requesters to edit documents, including delete and add | [optional] [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/SubFormFieldGroup.md b/docs/SubFormFieldGroup.md index 82a52fe..7928371 100644 --- a/docs/SubFormFieldGroup.md +++ b/docs/SubFormFieldGroup.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**GroupId** | **string** | ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. | -**GroupLabel** | **string** | Name of the group | -**Requirement** | **string** | 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. | +**GroupId** | **string** | ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. | **GroupLabel** | **string** | Name of the group | **Requirement** | **string** | 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 219166a..e834762 100644 --- a/docs/SubFormFieldRule.md +++ b/docs/SubFormFieldRule.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | Must be unique across all defined rules. | -**TriggerOperator** | **string** | Currently only `AND` is supported. Support for `OR` is being worked on. | [default to "AND"] -**Triggers** | [**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** | [**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. | +**Id** | **string** | Must be unique across all defined rules. | **TriggerOperator** | **string** | Currently only `AND` is supported. Support for `OR` is being worked on. | [default to "AND"]**Triggers** | [**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** | [**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 83e89ce..96028d9 100644 --- a/docs/SubFormFieldRuleAction.md +++ b/docs/SubFormFieldRuleAction.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Hidden** | **bool** | `true` to hide the target field when rule is satisfied, otherwise `false`. | -**Type** | **string** | | -**FieldId** | **string** | **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] -**GroupId** | **string** | **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] +**Hidden** | **bool** | `true` to hide the target field when rule is satisfied, otherwise `false`. | **Type** | **string** | | **FieldId** | **string** | **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] **GroupId** | **string** | **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] [[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 e2ee203..e6b829e 100644 --- a/docs/SubFormFieldRuleTrigger.md +++ b/docs/SubFormFieldRuleTrigger.md @@ -4,10 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **string** | 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** | **string** | 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** | **string** | **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] -**Values** | **List<string>** | **values** or **value** is required, but not both.

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

- `any` - `none` | [optional] +**Id** | **string** | 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** | **string** | 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** | **string** | **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] **Values** | **List<string>** | **values** or **value** is required, but not both.

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

- `any` - `none` | [optional] [[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 cadb43e..e684c8b 100644 --- a/docs/SubFormFieldsPerDocumentBase.md +++ b/docs/SubFormFieldsPerDocumentBase.md @@ -5,17 +5,7 @@ The fields that should appear on the document, expressed as an array of objects. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**DocumentIndex** | **int** | Represents the integer index of the `file` or `file_url` document the field should be attached to. | -**ApiId** | **string** | 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** | **string** | 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** | **string** | | -**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. | -**Name** | **string** | Display name for the field. | [optional] -**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. | [optional] +**DocumentIndex** | **int** | Represents the integer index of the `file` or `file_url` document the field should be attached to. | **ApiId** | **string** | 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** | **string** | 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** | **string** | | **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. | **Name** | **string** | Display name for the field. | [optional] **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. | [optional] [[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 2befe92..3e099fb 100644 --- a/docs/SubFormFieldsPerDocumentCheckbox.md +++ b/docs/SubFormFieldsPerDocumentCheckbox.md @@ -15,9 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **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. | [optional] -**Type** | **string** | A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. | [default to "checkbox"] -**IsChecked** | **bool** | `true` for checking the checkbox field by default, otherwise `false`. | -**Group** | **string** | String referencing group defined in `form_field_groups` parameter. | [optional] +**Type** | **string** | A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. | [default to "checkbox"]**IsChecked** | **bool** | `true` for checking the checkbox field by default, otherwise `false`. | **Group** | **string** | String referencing group defined in `form_field_groups` parameter. | [optional] [[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 3a9f886..1e7bf64 100644 --- a/docs/SubFormFieldsPerDocumentDateSigned.md +++ b/docs/SubFormFieldsPerDocumentDateSigned.md @@ -15,9 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **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. | [optional] -**Type** | **string** | A date. Use the `SubFormFieldsPerDocumentDateSigned` class. | [default to "date_signed"] -**FontFamily** | **string** | Font family for the field. | [optional] -**FontSize** | **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] [default to 12] +**Type** | **string** | A date. Use the `SubFormFieldsPerDocumentDateSigned` class. | [default to "date_signed"]**FontFamily** | **string** | Font family for the field. | [optional] **FontSize** | **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] [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 4e40162..d23c8c6 100644 --- a/docs/SubFormFieldsPerDocumentDropdown.md +++ b/docs/SubFormFieldsPerDocumentDropdown.md @@ -15,11 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **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. | [optional] -**Type** | **string** | An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. | [default to "dropdown"] -**Options** | **List<string>** | Array of string values representing dropdown values. | -**Content** | **string** | Selected value in `options` array. Value must exist in array. | [optional] -**FontFamily** | **string** | Font family for the field. | [optional] -**FontSize** | **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] [default to 12] +**Type** | **string** | An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. | [default to "dropdown"]**Options** | **List<string>** | Array of string values representing dropdown values. | **Content** | **string** | Selected value in `options` array. Value must exist in array. | [optional] **FontFamily** | **string** | Font family for the field. | [optional] **FontSize** | **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] [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 d47a6bf..e929833 100644 --- a/docs/SubFormFieldsPerDocumentFontEnum.md +++ b/docs/SubFormFieldsPerDocumentFontEnum.md @@ -5,5 +5,6 @@ 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 6b3845f..aea6fa4 100644 --- a/docs/SubFormFieldsPerDocumentHyperlink.md +++ b/docs/SubFormFieldsPerDocumentHyperlink.md @@ -15,11 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **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. | [optional] -**Type** | **string** | A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. | [default to "hyperlink"] -**Content** | **string** | Link Text. | -**ContentUrl** | **string** | Link URL. | -**FontFamily** | **string** | Font family for the field. | [optional] -**FontSize** | **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] [default to 12] +**Type** | **string** | A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. | [default to "hyperlink"]**Content** | **string** | Link Text. | **ContentUrl** | **string** | Link URL. | **FontFamily** | **string** | Font family for the field. | [optional] **FontSize** | **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] [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/SubFormFieldsPerDocumentRadio.md b/docs/SubFormFieldsPerDocumentRadio.md index 3340d56..d8b4ec7 100644 --- a/docs/SubFormFieldsPerDocumentRadio.md +++ b/docs/SubFormFieldsPerDocumentRadio.md @@ -15,9 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **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. | [optional] -**Type** | **string** | An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. | [default to "radio"] -**Group** | **string** | String referencing group defined in `form_field_groups` parameter. | -**IsChecked** | **bool** | `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. | +**Type** | **string** | An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. | [default to "radio"]**Group** | **string** | String referencing group defined in `form_field_groups` parameter. | **IsChecked** | **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/SubFormFieldsPerDocumentText.md b/docs/SubFormFieldsPerDocumentText.md index b40010e..c025afe 100644 --- a/docs/SubFormFieldsPerDocumentText.md +++ b/docs/SubFormFieldsPerDocumentText.md @@ -15,17 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **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. | [optional] -**Type** | **string** | A text input field. Use the `SubFormFieldsPerDocumentText` class. | [default to "text"] -**Placeholder** | **string** | Placeholder value for text field. | [optional] -**AutoFillType** | **string** | 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] -**LinkId** | **string** | Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. | [optional] -**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] -**ValidationType** | **string** | 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] -**ValidationCustomRegex** | **string** | | [optional] -**ValidationCustomRegexFormatLabel** | **string** | | [optional] -**Content** | **string** | Content of a `me_now` text field | [optional] -**FontFamily** | **string** | Font family for the field. | [optional] -**FontSize** | **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] [default to 12] +**Type** | **string** | A text input field. Use the `SubFormFieldsPerDocumentText` class. | [default to "text"]**Placeholder** | **string** | Placeholder value for text field. | [optional] **AutoFillType** | **string** | 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] **LinkId** | **string** | Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. | [optional] **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] **ValidationType** | **string** | 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] **ValidationCustomRegex** | **string** | | [optional] **ValidationCustomRegexFormatLabel** | **string** | | [optional] **Content** | **string** | Content of a `me_now` text field | [optional] **FontFamily** | **string** | Font family for the field. | [optional] **FontSize** | **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] [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 8611416..20fd614 100644 --- a/docs/SubFormFieldsPerDocumentTextMerge.md +++ b/docs/SubFormFieldsPerDocumentTextMerge.md @@ -15,9 +15,7 @@ Name | Type | Description | Notes **Y** | **int** | Location coordinates of the field in pixels. | **Name** | **string** | Display name for the field. | [optional] **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. | [optional] -**Type** | **string** | A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. | [default to "text-merge"] -**FontFamily** | **string** | Font family for the field. | [optional] -**FontSize** | **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] [default to 12] +**Type** | **string** | A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. | [default to "text-merge"]**FontFamily** | **string** | Font family for the field. | [optional] **FontSize** | **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] [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 b966065..73d875e 100644 --- a/docs/SubFormFieldsPerDocumentTypeEnum.md +++ b/docs/SubFormFieldsPerDocumentTypeEnum.md @@ -5,5 +5,6 @@ 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 76911af..d87cc90 100644 --- a/docs/SubMergeField.md +++ b/docs/SubMergeField.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the merge field. Must be unique. | -**Type** | **string** | The type of merge field. | +**Name** | **string** | The name of the merge field. Must be unique. | **Type** | **string** | 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 db5dc0a..6c5bf7d 100644 --- a/docs/SubOAuth.md +++ b/docs/SubOAuth.md @@ -5,8 +5,7 @@ OAuth related parameters. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CallbackUrl** | **string** | The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) | [optional] -**Scopes** | **List<string>** | A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). | [optional] +**CallbackUrl** | **string** | The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) | [optional] **Scopes** | **List<SubOAuth.ScopesEnum>** | A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). | [optional] [[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 8ae84f7..b37cae0 100644 --- a/docs/SubSignatureRequestGroupedSigners.md +++ b/docs/SubSignatureRequestGroupedSigners.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Group** | **string** | The name of the group. | -**Signers** | [**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`. | [optional] +**Group** | **string** | The name of the group. | **Signers** | [**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`. | [optional] [[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 a130657..4357879 100644 --- a/docs/SubSignatureRequestSigner.md +++ b/docs/SubSignatureRequestSigner.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the signer. | -**EmailAddress** | **string** | The email address of the signer. | -**Order** | **int?** | The order the signer is required to sign in. | [optional] -**Pin** | **string** | The 4- to 12-character access code that will secure this signer's signature page. | [optional] -**SmsPhoneNumber** | **string** | 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] -**SmsPhoneNumberType** | **string** | 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] +**Name** | **string** | The name of the signer. | **EmailAddress** | **string** | The email address of the signer. | **Order** | **int?** | The order the signer is required to sign in. | [optional] **Pin** | **string** | The 4- to 12-character access code that will secure this signer's signature page. | [optional] **SmsPhoneNumber** | **string** | 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] **SmsPhoneNumberType** | **string** | 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] [[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 4a30406..5789681 100644 --- a/docs/SubSignatureRequestTemplateSigner.md +++ b/docs/SubSignatureRequestTemplateSigner.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Role** | **string** | Must match an existing role in chosen Template(s). It's case-sensitive. | -**Name** | **string** | The name of the signer. | -**EmailAddress** | **string** | The email address of the signer. | -**Pin** | **string** | The 4- to 12-character access code that will secure this signer's signature page. | [optional] -**SmsPhoneNumber** | **string** | 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] -**SmsPhoneNumberType** | **string** | 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] +**Role** | **string** | Must match an existing role in chosen Template(s). It's case-sensitive. | **Name** | **string** | The name of the signer. | **EmailAddress** | **string** | The email address of the signer. | **Pin** | **string** | The 4- to 12-character access code that will secure this signer's signature page. | [optional] **SmsPhoneNumber** | **string** | 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] **SmsPhoneNumberType** | **string** | 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] [[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 c0ec40e..a656741 100644 --- a/docs/SubSigningOptions.md +++ b/docs/SubSigningOptions.md @@ -5,11 +5,7 @@ This allows the requester to specify the types allowed for creating a signature. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**DefaultType** | **string** | The default type shown (limited to the listed types) | -**Draw** | **bool** | Allows drawing the signature | [optional] [default to false] -**Phone** | **bool** | Allows using a smartphone to email the signature | [optional] [default to false] -**Type** | **bool** | Allows typing the signature | [optional] [default to false] -**Upload** | **bool** | Allows uploading the signature | [optional] [default to false] +**DefaultType** | **string** | The default type shown (limited to the listed types) | **Draw** | **bool** | Allows drawing the signature | [optional] [default to false]**Phone** | **bool** | Allows using a smartphone to email the signature | [optional] [default to false]**Type** | **bool** | Allows typing the signature | [optional] [default to false]**Upload** | **bool** | Allows uploading the signature | [optional] [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 ebdb96c..b2c09e6 100644 --- a/docs/SubTeamResponse.md +++ b/docs/SubTeamResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TeamId** | **string** | The id of a team | [optional] -**Name** | **string** | The name of a team | [optional] +**TeamId** | **string** | The id of a team | [optional] **Name** | **string** | The name of a team | [optional] [[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 ece06e4..ecf59c5 100644 --- a/docs/SubTemplateRole.md +++ b/docs/SubTemplateRole.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The role name of the signer that will be displayed when the template is used to create a signature request. | [optional] -**Order** | **int?** | The order in which this signer role is required to sign. | [optional] +**Name** | **string** | The role name of the signer that will be displayed when the template is used to create a signature request. | [optional] **Order** | **int?** | The order in which this signer role is required to sign. | [optional] [[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 4a7ca39..46bdfda 100644 --- a/docs/SubUnclaimedDraftSigner.md +++ b/docs/SubUnclaimedDraftSigner.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EmailAddress** | **string** | The email address of the signer. | -**Name** | **string** | The name of the signer. | -**Order** | **int?** | The order the signer is required to sign in. | [optional] +**EmailAddress** | **string** | The email address of the signer. | **Name** | **string** | The name of the signer. | **Order** | **int?** | The order the signer is required to sign in. | [optional] [[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 79f0978..43be64a 100644 --- a/docs/SubUnclaimedDraftTemplateSigner.md +++ b/docs/SubUnclaimedDraftTemplateSigner.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Role** | **string** | Must match an existing role in chosen Template(s). | -**Name** | **string** | The name of the signer filling the role of `role`. | -**EmailAddress** | **string** | The email address of the signer filling the role of `role`. | +**Role** | **string** | Must match an existing role in chosen Template(s). | **Name** | **string** | The name of the signer filling the role of `role`. | **EmailAddress** | **string** | 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 295d243..930a345 100644 --- a/docs/SubWhiteLabelingOptions.md +++ b/docs/SubWhiteLabelingOptions.md @@ -5,21 +5,7 @@ An array of elements and values serialized to a string, to be used to customize Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**HeaderBackgroundColor** | **string** | | [optional] [default to "#1A1A1A"] -**LegalVersion** | **string** | | [optional] [default to LegalVersionEnum.Terms1] -**LinkColor** | **string** | | [optional] [default to "#00B3E6"] -**PageBackgroundColor** | **string** | | [optional] [default to "#F7F8F9"] -**PrimaryButtonColor** | **string** | | [optional] [default to "#00B3E6"] -**PrimaryButtonColorHover** | **string** | | [optional] [default to "#00B3E6"] -**PrimaryButtonTextColor** | **string** | | [optional] [default to "#FFFFFF"] -**PrimaryButtonTextColorHover** | **string** | | [optional] [default to "#FFFFFF"] -**SecondaryButtonColor** | **string** | | [optional] [default to "#FFFFFF"] -**SecondaryButtonColorHover** | **string** | | [optional] [default to "#FFFFFF"] -**SecondaryButtonTextColor** | **string** | | [optional] [default to "#00B3E6"] -**SecondaryButtonTextColorHover** | **string** | | [optional] [default to "#00B3E6"] -**TextColor1** | **string** | | [optional] [default to "#808080"] -**TextColor2** | **string** | | [optional] [default to "#FFFFFF"] -**ResetToDefault** | **bool** | Resets white labeling options to defaults. Only useful when updating an API App. | [optional] +**HeaderBackgroundColor** | **string** | | [optional] [default to "#1A1A1A"]**LegalVersion** | **string** | | [optional] [default to LegalVersionEnum.Terms1]**LinkColor** | **string** | | [optional] [default to "#00B3E6"]**PageBackgroundColor** | **string** | | [optional] [default to "#F7F8F9"]**PrimaryButtonColor** | **string** | | [optional] [default to "#00B3E6"]**PrimaryButtonColorHover** | **string** | | [optional] [default to "#00B3E6"]**PrimaryButtonTextColor** | **string** | | [optional] [default to "#FFFFFF"]**PrimaryButtonTextColorHover** | **string** | | [optional] [default to "#FFFFFF"]**SecondaryButtonColor** | **string** | | [optional] [default to "#FFFFFF"]**SecondaryButtonColorHover** | **string** | | [optional] [default to "#FFFFFF"]**SecondaryButtonTextColor** | **string** | | [optional] [default to "#00B3E6"]**SecondaryButtonTextColorHover** | **string** | | [optional] [default to "#00B3E6"]**TextColor1** | **string** | | [optional] [default to "#808080"]**TextColor2** | **string** | | [optional] [default to "#FFFFFF"]**ResetToDefault** | **bool** | Resets white labeling options to defaults. Only useful when updating an API App. | [optional] [[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 89478f0..878edbb 100644 --- a/docs/TeamAddMemberRequest.md +++ b/docs/TeamAddMemberRequest.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | `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] -**EmailAddress** | **string** | `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] -**Role** | **string** | A role member will take in a new Team.

**NOTE:** This parameter is used only if `team_id` is provided. | [optional] +**AccountId** | **string** | `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] **EmailAddress** | **string** | `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] **Role** | **string** | A role member will take in a new Team.

**NOTE:** This parameter is used only if `team_id` is provided. | [optional] [[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 90d89f0..64d8dd5 100644 --- a/docs/TeamApi.md +++ b/docs/TeamApi.md @@ -15,7 +15,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**TeamSubTeams**](TeamApi.md#teamsubteams) | **GET** /team/sub_teams/{team_id} | List Sub Teams | | [**TeamUpdate**](TeamApi.md#teamupdate) | **PUT** /team | Update Team | - + # **TeamAddMember** > TeamGetResponse TeamAddMember (TeamAddMemberRequest teamAddMemberRequest, string? teamId = null) @@ -113,7 +113,7 @@ catch (ApiException e) [[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) - + # **TeamCreate** > TeamGetResponse TeamCreate (TeamCreateRequest teamCreateRequest) @@ -210,7 +210,7 @@ catch (ApiException e) [[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) - + # **TeamDelete** > void TeamDelete () @@ -295,7 +295,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) - + # **TeamGet** > TeamGetResponse TeamGet () @@ -384,7 +384,7 @@ This endpoint does not need any parameter. [[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) - + # **TeamInfo** > TeamGetInfoResponse TeamInfo (string? teamId = null) @@ -477,7 +477,7 @@ catch (ApiException e) [[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) - + # **TeamInvites** > TeamInvitesResponse TeamInvites (string? emailAddress = null) @@ -571,7 +571,7 @@ catch (ApiException e) [[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) - + # **TeamMembers** > TeamMembersResponse TeamMembers (string teamId, int? page = null, int? pageSize = null) @@ -667,7 +667,7 @@ catch (ApiException e) [[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) - + # **TeamRemoveMember** > TeamGetResponse TeamRemoveMember (TeamRemoveMemberRequest teamRemoveMemberRequest) @@ -765,7 +765,7 @@ catch (ApiException e) [[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) - + # **TeamSubTeams** > TeamSubTeamsResponse TeamSubTeams (string teamId, int? page = null, int? pageSize = null) @@ -861,7 +861,7 @@ catch (ApiException e) [[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) - + # **TeamUpdate** > TeamGetResponse TeamUpdate (TeamUpdateRequest teamUpdateRequest) diff --git a/docs/TeamGetInfoResponse.md b/docs/TeamGetInfoResponse.md index bacc799..b0f876e 100644 --- a/docs/TeamGetInfoResponse.md +++ b/docs/TeamGetInfoResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Team** | [**TeamInfoResponse**](TeamInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Team** | [**TeamInfoResponse**](TeamInfoResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 45046b1..a3a8293 100644 --- a/docs/TeamGetResponse.md +++ b/docs/TeamGetResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Team** | [**TeamResponse**](TeamResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Team** | [**TeamResponse**](TeamResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 ac3a4e8..8f487d8 100644 --- a/docs/TeamInfoResponse.md +++ b/docs/TeamInfoResponse.md @@ -4,11 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TeamId** | **string** | The id of a team | [optional] -**TeamParent** | [**TeamParentResponse**](TeamParentResponse.md) | | [optional] -**Name** | **string** | The name of a team | [optional] -**NumMembers** | **int** | Number of members within a team | [optional] -**NumSubTeams** | **int** | Number of sub teams within a team | [optional] +**TeamId** | **string** | The id of a team | [optional] **TeamParent** | [**TeamParentResponse**](TeamParentResponse.md) | | [optional] **Name** | **string** | The name of a team | [optional] **NumMembers** | **int** | Number of members within a team | [optional] **NumSubTeams** | **int** | Number of sub teams within a team | [optional] [[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 1258000..ed0e48b 100644 --- a/docs/TeamInviteResponse.md +++ b/docs/TeamInviteResponse.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EmailAddress** | **string** | Email address of the user invited to this team. | [optional] -**TeamId** | **string** | Id of the team. | [optional] -**Role** | **string** | Role of the user invited to this team. | [optional] -**SentAt** | **int** | Timestamp when the invitation was sent. | [optional] -**RedeemedAt** | **int** | Timestamp when the invitation was redeemed. | [optional] -**ExpiresAt** | **int** | Timestamp when the invitation is expiring. | [optional] +**EmailAddress** | **string** | Email address of the user invited to this team. | [optional] **TeamId** | **string** | Id of the team. | [optional] **Role** | **string** | Role of the user invited to this team. | [optional] **SentAt** | **int** | Timestamp when the invitation was sent. | [optional] **RedeemedAt** | **int** | Timestamp when the invitation was redeemed. | [optional] **ExpiresAt** | **int** | Timestamp when the invitation is expiring. | [optional] [[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 ffc82c4..393ff71 100644 --- a/docs/TeamInvitesResponse.md +++ b/docs/TeamInvitesResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TeamInvites** | [**List<TeamInviteResponse>**](TeamInviteResponse.md) | Contains a list of team invites and their roles. | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] +**TeamInvites** | [**List<TeamInviteResponse>**](TeamInviteResponse.md) | Contains a list of team invites and their roles. | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] [[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 dde5266..d8f0e5d 100644 --- a/docs/TeamMemberResponse.md +++ b/docs/TeamMemberResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | Account id of the team member. | [optional] -**EmailAddress** | **string** | Email address of the team member. | [optional] -**Role** | **string** | The specific role a member has on the team. | [optional] +**AccountId** | **string** | Account id of the team member. | [optional] **EmailAddress** | **string** | Email address of the team member. | [optional] **Role** | **string** | The specific role a member has on the team. | [optional] [[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 fd51ffe..6549335 100644 --- a/docs/TeamMembersResponse.md +++ b/docs/TeamMembersResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TeamMembers** | [**List<TeamMemberResponse>**](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] +**TeamMembers** | [**List<TeamMemberResponse>**](TeamMemberResponse.md) | Contains a list of team members and their roles for a specific team. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] [[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 56bd35b..6db34d8 100644 --- a/docs/TeamParentResponse.md +++ b/docs/TeamParentResponse.md @@ -5,8 +5,7 @@ Information about the parent team if a team has one, set to `null` otherwise. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TeamId** | **string** | The id of a team | [optional] -**Name** | **string** | The name of a team | [optional] +**TeamId** | **string** | The id of a team | [optional] **Name** | **string** | The name of a team | [optional] [[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 bc227b9..475caf0 100644 --- a/docs/TeamRemoveMemberRequest.md +++ b/docs/TeamRemoveMemberRequest.md @@ -4,11 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Account id to remove from your Team. | [optional] -**EmailAddress** | **string** | **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] -**NewOwnerEmailAddress** | **string** | 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] -**NewTeamId** | **string** | Id of the new Team. | [optional] -**NewRole** | **string** | A new role member will take in a new Team.

**NOTE:** This parameter is used only if `new_team_id` is provided. | [optional] +**AccountId** | **string** | **account_id** or **email_address** is required. If both are provided, the account id prevails.

Account id to remove from your Team. | [optional] **EmailAddress** | **string** | **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] **NewOwnerEmailAddress** | **string** | 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] **NewTeamId** | **string** | Id of the new Team. | [optional] **NewRole** | **string** | A new role member will take in a new Team.

**NOTE:** This parameter is used only if `new_team_id` is provided. | [optional] [[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 e8a14f5..977696c 100644 --- a/docs/TeamResponse.md +++ b/docs/TeamResponse.md @@ -5,10 +5,7 @@ Contains information about your team and its members Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of your Team | [optional] -**Accounts** | [**List<AccountResponse>**](AccountResponse.md) | | [optional] -**InvitedAccounts** | [**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`. | [optional] -**InvitedEmails** | **List<string>** | A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. | [optional] +**Name** | **string** | The name of your Team | [optional] **Accounts** | [**List<AccountResponse>**](AccountResponse.md) | | [optional] **InvitedAccounts** | [**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`. | [optional] **InvitedEmails** | **List<string>** | A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. | [optional] [[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 41faf83..f25e026 100644 --- a/docs/TeamSubTeamsResponse.md +++ b/docs/TeamSubTeamsResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SubTeams** | [**List<SubTeamResponse>**](SubTeamResponse.md) | Contains a list with sub teams. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] +**SubTeams** | [**List<SubTeamResponse>**](SubTeamResponse.md) | Contains a list with sub teams. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | | [optional] [[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 059dc1e..8fd19bc 100644 --- a/docs/TemplateAddUserRequest.md +++ b/docs/TemplateAddUserRequest.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The id of the Account to give access to the Template.
**NOTE:** The account id prevails if email address is also provided. | [optional] -**EmailAddress** | **string** | The email address of the Account to give access to the Template.
**NOTE:** The account id prevails if it is also provided. | [optional] -**SkipNotification** | **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] [default to false] +**AccountId** | **string** | The id of the Account to give access to the Template.
**NOTE:** The account id prevails if email address is also provided. | [optional] **EmailAddress** | **string** | The email address of the Account to give access to the Template.
**NOTE:** The account id prevails if it is also provided. | [optional] **SkipNotification** | **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] [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 60384f6..2f6cf98 100644 --- a/docs/TemplateApi.md +++ b/docs/TemplateApi.md @@ -16,7 +16,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**TemplateRemoveUser**](TemplateApi.md#templateremoveuser) | **POST** /template/remove_user/{template_id} | Remove User from Template | | [**TemplateUpdateFiles**](TemplateApi.md#templateupdatefiles) | **POST** /template/update_files/{template_id} | Update Template Files | - + # **TemplateAddUser** > TemplateGetResponse TemplateAddUser (string templateId, TemplateAddUserRequest templateAddUserRequest) @@ -116,7 +116,7 @@ catch (ApiException e) [[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) - + # **TemplateCreate** > TemplateCreateResponse TemplateCreate (TemplateCreateRequest templateCreateRequest) @@ -256,7 +256,7 @@ catch (ApiException e) [[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) - + # **TemplateCreateEmbeddedDraft** > TemplateCreateEmbeddedDraftResponse TemplateCreateEmbeddedDraft (TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest) @@ -396,7 +396,7 @@ catch (ApiException e) [[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) - + # **TemplateDelete** > void TemplateDelete (string templateId) @@ -487,7 +487,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) - + # **TemplateFiles** > System.IO.Stream TemplateFiles (string templateId, string? fileType = null) @@ -587,7 +587,7 @@ catch (ApiException e) [[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) - + # **TemplateFilesAsDataUri** > FileResponseDataUri TemplateFilesAsDataUri (string templateId) @@ -682,7 +682,7 @@ catch (ApiException e) [[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) - + # **TemplateFilesAsFileUrl** > FileResponse TemplateFilesAsFileUrl (string templateId, int? forceDownload = null) @@ -778,7 +778,7 @@ catch (ApiException e) [[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) - + # **TemplateGet** > TemplateGetResponse TemplateGet (string templateId) @@ -873,7 +873,7 @@ catch (ApiException e) [[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) - + # **TemplateList** > TemplateListResponse TemplateList (string? accountId = null, int? page = null, int? pageSize = null, string? query = null) @@ -971,7 +971,7 @@ catch (ApiException e) [[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) - + # **TemplateRemoveUser** > TemplateGetResponse TemplateRemoveUser (string templateId, TemplateRemoveUserRequest templateRemoveUserRequest) @@ -1071,7 +1071,7 @@ catch (ApiException e) [[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) - + # **TemplateUpdateFiles** > TemplateUpdateFilesResponse TemplateUpdateFiles (string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest) diff --git a/docs/TemplateCreateEmbeddedDraftRequest.md b/docs/TemplateCreateEmbeddedDraftRequest.md index 0ce33cb..299d6fe 100644 --- a/docs/TemplateCreateEmbeddedDraftRequest.md +++ b/docs/TemplateCreateEmbeddedDraftRequest.md @@ -4,31 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | 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** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**FileUrls** | **List<string>** | 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] -**AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. | [optional] [default to true] -**AllowReassign** | **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] [default to false] -**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] -**CcRoles** | **List<string>** | The CC roles that must be assigned when using the template to send a signature request | [optional] -**EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] -**FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] -**ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false] -**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false] -**FormFieldGroups** | [**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`. | [optional] -**FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] -**FormFieldsPerDocument** | [**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` | [optional] -**MergeFields** | [**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. | [optional] -**Message** | **string** | The default template email message. | [optional] -**Metadata** | **Dictionary<string, 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. | [optional] -**ShowPreview** | **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] [default to false] -**ShowProgressStepper** | **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] [default to true] -**SignerRoles** | [**List<SubTemplateRole>**](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | [optional] -**SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false] -**Subject** | **string** | The template title (alias). | [optional] -**TestMode** | **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] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] -**UsePreexistingFields** | **bool** | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [optional] [default to false] +**ClientId** | **string** | 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** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | 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] **AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. | [optional] [default to true]**AllowReassign** | **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] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcRoles** | **List<string>** | The CC roles that must be assigned when using the template to send a signature request | [optional] **EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false]**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false]**FormFieldGroups** | [**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`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **FormFieldsPerDocument** | [**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` | [optional] **MergeFields** | [**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. | [optional] **Message** | **string** | The default template email message. | [optional] **Metadata** | **Dictionary<string, 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. | [optional] **ShowPreview** | **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] [default to false]**ShowProgressStepper** | **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] [default to true]**SignerRoles** | [**List<SubTemplateRole>**](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | [optional] **SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false]**Subject** | **string** | The template title (alias). | [optional] **TestMode** | **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] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **UsePreexistingFields** | **bool** | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [optional] [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 cf5a675..b3a03c0 100644 --- a/docs/TemplateCreateEmbeddedDraftResponse.md +++ b/docs/TemplateCreateEmbeddedDraftResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Template** | [**TemplateCreateEmbeddedDraftResponseTemplate**](TemplateCreateEmbeddedDraftResponseTemplate.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Template** | [**TemplateCreateEmbeddedDraftResponseTemplate**](TemplateCreateEmbeddedDraftResponseTemplate.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 0e13091..d23893d 100644 --- a/docs/TemplateCreateEmbeddedDraftResponseTemplate.md +++ b/docs/TemplateCreateEmbeddedDraftResponseTemplate.md @@ -5,10 +5,7 @@ Template object with parameters: `template_id`, `edit_url`, `expires_at`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateId** | **string** | The id of the Template. | [optional] -**EditUrl** | **string** | Link to edit the template. | [optional] -**ExpiresAt** | **int** | When the link expires. | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**TemplateId** | **string** | The id of the Template. | [optional] **EditUrl** | **string** | Link to edit the template. | [optional] **ExpiresAt** | **int** | When the link expires. | [optional] **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 a0e9860..9a80d0c 100644 --- a/docs/TemplateCreateRequest.md +++ b/docs/TemplateCreateRequest.md @@ -4,24 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FormFieldsPerDocument** | [**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` | -**SignerRoles** | [**List<SubTemplateRole>**](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**FileUrls** | **List<string>** | 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] -**AllowReassign** | **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] [default to false] -**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] -**CcRoles** | **List<string>** | The CC roles that must be assigned when using the template to send a signature request | [optional] -**ClientId** | **string** | 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] -**FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] -**FormFieldGroups** | [**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`. | [optional] -**FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] -**MergeFields** | [**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. | [optional] -**Message** | **string** | The default template email message. | [optional] -**Metadata** | **Dictionary<string, 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. | [optional] -**Subject** | **string** | The template title (alias). | [optional] -**TestMode** | **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] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] -**UsePreexistingFields** | **bool** | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [optional] [default to false] +**FormFieldsPerDocument** | [**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` | **SignerRoles** | [**List<SubTemplateRole>**](SubTemplateRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | 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] **AllowReassign** | **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] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcRoles** | **List<string>** | The CC roles that must be assigned when using the template to send a signature request | [optional] **ClientId** | **string** | 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] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **FormFieldGroups** | [**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`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **MergeFields** | [**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. | [optional] **Message** | **string** | The default template email message. | [optional] **Metadata** | **Dictionary<string, 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. | [optional] **Subject** | **string** | The template title (alias). | [optional] **TestMode** | **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] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **UsePreexistingFields** | **bool** | Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). | [optional] [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 cbd87a7..75bab14 100644 --- a/docs/TemplateCreateResponse.md +++ b/docs/TemplateCreateResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Template** | [**TemplateCreateResponseTemplate**](TemplateCreateResponseTemplate.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Template** | [**TemplateCreateResponseTemplate**](TemplateCreateResponseTemplate.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 723cdfc..830c7a9 100644 --- a/docs/TemplateEditResponse.md +++ b/docs/TemplateEditResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateId** | **string** | The id of the Template. | [optional] +**TemplateId** | **string** | 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 ee781ce..7a301e1 100644 --- a/docs/TemplateGetResponse.md +++ b/docs/TemplateGetResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Template** | [**TemplateResponse**](TemplateResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Template** | [**TemplateResponse**](TemplateResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 b5bb9aa..7bb37dc 100644 --- a/docs/TemplateListResponse.md +++ b/docs/TemplateListResponse.md @@ -4,9 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Templates** | [**List<TemplateResponse>**](TemplateResponse.md) | List of templates that the API caller has access to. | [optional] -**ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**Templates** | [**List<TemplateResponse>**](TemplateResponse.md) | List of templates that the API caller has access to. | **ListInfo** | [**ListInfoResponse**](ListInfoResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 1e2280f..98922e5 100644 --- a/docs/TemplateRemoveUserRequest.md +++ b/docs/TemplateRemoveUserRequest.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | [optional] -**EmailAddress** | **string** | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | [optional] +**AccountId** | **string** | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | [optional] **EmailAddress** | **string** | The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. | [optional] [[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 f25de6a..ce17e37 100644 --- a/docs/TemplateResponse.md +++ b/docs/TemplateResponse.md @@ -5,21 +5,7 @@ Contains information about the templates you and your team have created. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateId** | **string** | The id of the Template. | [optional] -**Title** | **string** | 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] -**Message** | **string** | 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] -**UpdatedAt** | **int** | Time the template was last updated. | [optional] -**IsEmbedded** | **bool?** | `true` if this template was created using an embedded flow, `false` if it was created on our website. | [optional] -**IsCreator** | **bool?** | `true` if you are the owner of this template, `false` if it's been shared with you by a team member. | [optional] -**CanEdit** | **bool?** | Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). | [optional] -**IsLocked** | **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. | [optional] -**Metadata** | **Object** | The metadata attached to the template. | [optional] -**SignerRoles** | [**List<TemplateResponseSignerRole>**](TemplateResponseSignerRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | [optional] -**CcRoles** | [**List<TemplateResponseCCRole>**](TemplateResponseCCRole.md) | An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. | [optional] -**Documents** | [**List<TemplateResponseDocument>**](TemplateResponseDocument.md) | An array describing each document associated with this Template. Includes form field data for each document. | [optional] -**CustomFields** | [**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. | [optional] -**NamedFormFields** | [**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. | [optional] -**Accounts** | [**List<TemplateResponseAccount>**](TemplateResponseAccount.md) | An array of the Accounts that can use this Template. | [optional] +**TemplateId** | **string** | The id of the Template. | [optional] **Title** | **string** | 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] **Message** | **string** | 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] **UpdatedAt** | **int** | Time the template was last updated. | [optional] **IsEmbedded** | **bool?** | `true` if this template was created using an embedded flow, `false` if it was created on our website. | [optional] **IsCreator** | **bool?** | `true` if you are the owner of this template, `false` if it's been shared with you by a team member. | [optional] **CanEdit** | **bool?** | Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). | [optional] **IsLocked** | **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. | [optional] **Metadata** | **Object** | The metadata attached to the template. | [optional] **SignerRoles** | [**List<TemplateResponseSignerRole>**](TemplateResponseSignerRole.md) | An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. | [optional] **CcRoles** | [**List<TemplateResponseCCRole>**](TemplateResponseCCRole.md) | An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. | [optional] **Documents** | [**List<TemplateResponseDocument>**](TemplateResponseDocument.md) | An array describing each document associated with this Template. Includes form field data for each document. | [optional] **CustomFields** | [**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. | [optional] **NamedFormFields** | [**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. | [optional] **Accounts** | [**List<TemplateResponseAccount>**](TemplateResponseAccount.md) | An array of the Accounts that can use this Template. | [optional] [[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 8713247..b69b4eb 100644 --- a/docs/TemplateResponseAccount.md +++ b/docs/TemplateResponseAccount.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccountId** | **string** | The id of the Account. | [optional] -**EmailAddress** | **string** | The email address associated with the Account. | [optional] -**IsLocked** | **bool** | Returns `true` if the user has been locked out of their account by a team admin. | [optional] -**IsPaidHs** | **bool** | Returns `true` if the user has a paid Dropbox Sign account. | [optional] -**IsPaidHf** | **bool** | Returns `true` if the user has a paid HelloFax account. | [optional] -**Quotas** | [**TemplateResponseAccountQuota**](TemplateResponseAccountQuota.md) | | [optional] +**AccountId** | **string** | The id of the Account. | [optional] **EmailAddress** | **string** | The email address associated with the Account. | [optional] **IsLocked** | **bool** | Returns `true` if the user has been locked out of their account by a team admin. | [optional] **IsPaidHs** | **bool** | Returns `true` if the user has a paid Dropbox Sign account. | [optional] **IsPaidHf** | **bool** | Returns `true` if the user has a paid HelloFax account. | [optional] **Quotas** | [**TemplateResponseAccountQuota**](TemplateResponseAccountQuota.md) | | [optional] [[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 c57a271..5051dc5 100644 --- a/docs/TemplateResponseAccountQuota.md +++ b/docs/TemplateResponseAccountQuota.md @@ -5,10 +5,7 @@ An array of the designated CC roles that must be specified when sending a Signat Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplatesLeft** | **int** | API templates remaining. | [optional] -**ApiSignatureRequestsLeft** | **int** | API signature requests remaining. | [optional] -**DocumentsLeft** | **int** | Signature requests remaining. | [optional] -**SmsVerificationsLeft** | **int** | SMS verifications remaining. | [optional] +**TemplatesLeft** | **int** | API templates remaining. | [optional] **ApiSignatureRequestsLeft** | **int** | API signature requests remaining. | [optional] **DocumentsLeft** | **int** | Signature requests remaining. | [optional] **SmsVerificationsLeft** | **int** | SMS verifications remaining. | [optional] [[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 09b0716..6847d7b 100644 --- a/docs/TemplateResponseDocument.md +++ b/docs/TemplateResponseDocument.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | Name of the associated file. | [optional] -**Index** | **int** | Document ordering, the lowest index is displayed first and the highest last (0-based indexing). | [optional] -**FieldGroups** | [**List<TemplateResponseDocumentFieldGroup>**](TemplateResponseDocumentFieldGroup.md) | An array of Form Field Group objects. | [optional] -**FormFields** | [**List<TemplateResponseDocumentFormFieldBase>**](TemplateResponseDocumentFormFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | [optional] -**CustomFields** | [**List<TemplateResponseDocumentCustomFieldBase>**](TemplateResponseDocumentCustomFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | [optional] -**StaticFields** | [**List<TemplateResponseDocumentStaticFieldBase>**](TemplateResponseDocumentStaticFieldBase.md) | An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. | [optional] +**Name** | **string** | Name of the associated file. | [optional] **Index** | **int** | Document ordering, the lowest index is displayed first and the highest last (0-based indexing). | [optional] **FieldGroups** | [**List<TemplateResponseDocumentFieldGroup>**](TemplateResponseDocumentFieldGroup.md) | An array of Form Field Group objects. | [optional] **FormFields** | [**List<TemplateResponseDocumentFormFieldBase>**](TemplateResponseDocumentFormFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | [optional] **CustomFields** | [**List<TemplateResponseDocumentCustomFieldBase>**](TemplateResponseDocumentCustomFieldBase.md) | An array of Form Field objects containing the name and type of each named field. | [optional] **StaticFields** | [**List<TemplateResponseDocumentStaticFieldBase>**](TemplateResponseDocumentStaticFieldBase.md) | An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. | [optional] [[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 6aba80b..9f349a7 100644 --- a/docs/TemplateResponseDocumentCustomFieldBase.md +++ b/docs/TemplateResponseDocumentCustomFieldBase.md @@ -5,16 +5,7 @@ An array of Form Field objects containing the name and type of each named field. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | -**ApiId** | **string** | The unique ID for this field. | [optional] -**Name** | **string** | The name of the Custom Field. | [optional] -**Signer** | **string** | The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). | [optional] -**X** | **int** | The horizontal offset in pixels for this form field. | [optional] -**Y** | **int** | The vertical offset in pixels for this form field. | [optional] -**Width** | **int** | The width in pixels of this form field. | [optional] -**Height** | **int** | The height in pixels of this form field. | [optional] -**Required** | **bool** | Boolean showing whether or not this field is required. | [optional] -**Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null`. | [optional] +**Type** | **string** | | **ApiId** | **string** | The unique ID for this field. | [optional] **Name** | **string** | The name of the Custom Field. | [optional] **Signer** | **string** | The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). | [optional] **X** | **int** | The horizontal offset in pixels for this form field. | [optional] **Y** | **int** | The vertical offset in pixels for this form field. | [optional] **Width** | **int** | The width in pixels of this form field. | [optional] **Height** | **int** | The height in pixels of this form field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null`. | [optional] [[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 4a63e9d..8db1636 100644 --- a/docs/TemplateResponseDocumentCustomFieldText.md +++ b/docs/TemplateResponseDocumentCustomFieldText.md @@ -14,11 +14,7 @@ Name | Type | Description | Notes **Height** | **int** | The height in pixels of this form field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null`. | [optional] -**Type** | **string** | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to "text"] -**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] -**IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] -**OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] -**FontFamily** | **string** | Font family used in this form field's text. | [optional] +**Type** | **string** | The type of this Custom Field. Only `text` and `checkbox` are currently supported.

* Text uses `TemplateResponseDocumentCustomFieldText`
* Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` | [default to "text"]**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] **IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] **OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] **FontFamily** | **string** | Font family used in this form field's text. | [optional] [[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 a1e7f00..0dfac71 100644 --- a/docs/TemplateResponseDocumentFieldGroup.md +++ b/docs/TemplateResponseDocumentFieldGroup.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the form field group. | [optional] -**Rule** | [**TemplateResponseDocumentFieldGroupRule**](TemplateResponseDocumentFieldGroupRule.md) | | [optional] +**Name** | **string** | The name of the form field group. | [optional] **Rule** | [**TemplateResponseDocumentFieldGroupRule**](TemplateResponseDocumentFieldGroupRule.md) | | [optional] [[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 0a92e92..44dd2eb 100644 --- a/docs/TemplateResponseDocumentFieldGroupRule.md +++ b/docs/TemplateResponseDocumentFieldGroupRule.md @@ -5,8 +5,7 @@ The rule used to validate checkboxes in the form field group. See [checkbox fiel Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Requirement** | **string** | 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] -**GroupLabel** | **string** | Name of the group | [optional] +**Requirement** | **string** | 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] **GroupLabel** | **string** | Name of the group | [optional] [[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 74429bf..0e941c7 100644 --- a/docs/TemplateResponseDocumentFormFieldBase.md +++ b/docs/TemplateResponseDocumentFormFieldBase.md @@ -5,16 +5,7 @@ An array of Form Field objects containing the name and type of each named field. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | -**ApiId** | **string** | A unique id for the form field. | [optional] -**Name** | **string** | The name of the form field. | [optional] -**Signer** | **string** | The signer of the Form Field. | [optional] -**X** | **int** | The horizontal offset in pixels for this form field. | [optional] -**Y** | **int** | The vertical offset in pixels for this form field. | [optional] -**Width** | **int** | The width in pixels of this form field. | [optional] -**Height** | **int** | The height in pixels of this form field. | [optional] -**Required** | **bool** | Boolean showing whether or not this field is required. | [optional] -**Group** | **string** | 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] +**Type** | **string** | | **ApiId** | **string** | A unique id for the form field. | [optional] **Name** | **string** | The name of the form field. | [optional] **Signer** | **string** | The signer of the Form Field. | [optional] **X** | **int** | The horizontal offset in pixels for this form field. | [optional] **Y** | **int** | The vertical offset in pixels for this form field. | [optional] **Width** | **int** | The width in pixels of this form field. | [optional] **Height** | **int** | The height in pixels of this form field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | 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] [[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 125ba1d..c5dc34e 100644 --- a/docs/TemplateResponseDocumentFormFieldHyperlink.md +++ b/docs/TemplateResponseDocumentFormFieldHyperlink.md @@ -14,11 +14,7 @@ Name | Type | Description | Notes **Height** | **int** | The height in pixels of this form field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | 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] -**Type** | **string** | 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"] -**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] -**IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] -**OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] -**FontFamily** | **string** | Font family used in this form field's text. | [optional] +**Type** | **string** | 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"]**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] **IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] **OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] **FontFamily** | **string** | Font family used in this form field's text. | [optional] [[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 cc0c064..9bcc478 100644 --- a/docs/TemplateResponseDocumentFormFieldText.md +++ b/docs/TemplateResponseDocumentFormFieldText.md @@ -14,12 +14,7 @@ Name | Type | Description | Notes **Height** | **int** | The height in pixels of this form field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | 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] -**Type** | **string** | 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"] -**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] -**IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] -**OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] -**FontFamily** | **string** | Font family used in this form field's text. | [optional] -**ValidationType** | **string** | 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] +**Type** | **string** | 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"]**AvgTextLength** | [**TemplateResponseFieldAvgTextLength**](TemplateResponseFieldAvgTextLength.md) | | [optional] **IsMultiline** | **bool** | Whether this form field is multiline text. | [optional] **OriginalFontSize** | **int** | Original font size used in this form field's text. | [optional] **FontFamily** | **string** | Font family used in this form field's text. | [optional] **ValidationType** | **string** | 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] [[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 4af0019..b147460 100644 --- a/docs/TemplateResponseDocumentStaticFieldBase.md +++ b/docs/TemplateResponseDocumentStaticFieldBase.md @@ -5,16 +5,7 @@ An array describing static overlay fields. **NOTE:** Only available for certain Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | | -**ApiId** | **string** | A unique id for the static field. | [optional] -**Name** | **string** | The name of the static field. | [optional] -**Signer** | **string** | The signer of the Static Field. | [optional] [default to "me_now"] -**X** | **int** | The horizontal offset in pixels for this static field. | [optional] -**Y** | **int** | The vertical offset in pixels for this static field. | [optional] -**Width** | **int** | The width in pixels of this static field. | [optional] -**Height** | **int** | The height in pixels of this static field. | [optional] -**Required** | **bool** | Boolean showing whether or not this field is required. | [optional] -**Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null`. | [optional] +**Type** | **string** | | **ApiId** | **string** | A unique id for the static field. | [optional] **Name** | **string** | The name of the static field. | [optional] **Signer** | **string** | The signer of the Static Field. | [optional] [default to "me_now"]**X** | **int** | The horizontal offset in pixels for this static field. | [optional] **Y** | **int** | The vertical offset in pixels for this static field. | [optional] **Width** | **int** | The width in pixels of this static field. | [optional] **Height** | **int** | The height in pixels of this static field. | [optional] **Required** | **bool** | Boolean showing whether or not this field is required. | [optional] **Group** | **string** | The name of the group this field is in. If this field is not a group, this defaults to `null`. | [optional] [[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 7909e61..a2773f0 100644 --- a/docs/TemplateResponseFieldAvgTextLength.md +++ b/docs/TemplateResponseFieldAvgTextLength.md @@ -5,8 +5,7 @@ Average text length in this field. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NumLines** | **int** | Number of lines. | [optional] -**NumCharsPerLine** | **int** | Number of characters per line. | [optional] +**NumLines** | **int** | Number of lines. | [optional] **NumCharsPerLine** | **int** | Number of characters per line. | [optional] [[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 20be54c..ddead2a 100644 --- a/docs/TemplateResponseSignerRole.md +++ b/docs/TemplateResponseSignerRole.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | The name of the Role. | [optional] -**Order** | **int** | If signer order is assigned this is the 0-based index for this role. | [optional] +**Name** | **string** | The name of the Role. | [optional] **Order** | **int** | If signer order is assigned this is the 0-based index for this role. | [optional] [[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 77529c0..ddaaac6 100644 --- a/docs/TemplateUpdateFilesRequest.md +++ b/docs/TemplateUpdateFilesRequest.md @@ -4,12 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client id of the app you're using to update this template. | [optional] -**Files** | **List<System.IO.Stream>** | 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] -**FileUrls** | **List<string>** | 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] -**Message** | **string** | The new default template email message. | [optional] -**Subject** | **string** | The new default template email subject. | [optional] -**TestMode** | **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] [default to false] +**ClientId** | **string** | Client id of the app you're using to update this template. | [optional] **Files** | **List<System.IO.Stream>** | 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] **FileUrls** | **List<string>** | 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] **Message** | **string** | The new default template email message. | [optional] **Subject** | **string** | The new default template email subject. | [optional] **TestMode** | **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] [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 5bd4210..8ff710e 100644 --- a/docs/TemplateUpdateFilesResponse.md +++ b/docs/TemplateUpdateFilesResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Template** | [**TemplateUpdateFilesResponseTemplate**](TemplateUpdateFilesResponseTemplate.md) | | [optional] +**Template** | [**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 34756c3..390961e 100644 --- a/docs/TemplateUpdateFilesResponseTemplate.md +++ b/docs/TemplateUpdateFilesResponseTemplate.md @@ -5,8 +5,7 @@ Contains template id Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TemplateId** | **string** | The id of the Template. | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**TemplateId** | **string** | The id of the Template. | [optional] **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 458e5d3..7d5a0e1 100644 --- a/docs/UnclaimedDraftApi.md +++ b/docs/UnclaimedDraftApi.md @@ -9,7 +9,7 @@ All URIs are relative to *https://api.hellosign.com/v3* | [**UnclaimedDraftCreateEmbeddedWithTemplate**](UnclaimedDraftApi.md#unclaimeddraftcreateembeddedwithtemplate) | **POST** /unclaimed_draft/create_embedded_with_template | Create Embedded Unclaimed Draft with Template | | [**UnclaimedDraftEditAndResend**](UnclaimedDraftApi.md#unclaimeddrafteditandresend) | **POST** /unclaimed_draft/edit_and_resend/{signature_request_id} | Edit and Resend Unclaimed Draft | - + # **UnclaimedDraftCreate** > UnclaimedDraftCreateResponse UnclaimedDraftCreate (UnclaimedDraftCreateRequest unclaimedDraftCreateRequest) @@ -155,7 +155,7 @@ catch (ApiException e) [[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) - + # **UnclaimedDraftCreateEmbedded** > UnclaimedDraftCreateResponse UnclaimedDraftCreateEmbedded (UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest) @@ -265,7 +265,7 @@ catch (ApiException e) [[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) - + # **UnclaimedDraftCreateEmbeddedWithTemplate** > UnclaimedDraftCreateResponse UnclaimedDraftCreateEmbeddedWithTemplate (UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest) @@ -378,7 +378,7 @@ catch (ApiException e) [[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) - + # **UnclaimedDraftEditAndResend** > UnclaimedDraftCreateResponse UnclaimedDraftEditAndResend (string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest) diff --git a/docs/UnclaimedDraftCreateEmbeddedRequest.md b/docs/UnclaimedDraftCreateEmbeddedRequest.md index 0da15d2..d3bc89c 100644 --- a/docs/UnclaimedDraftCreateEmbeddedRequest.md +++ b/docs/UnclaimedDraftCreateEmbeddedRequest.md @@ -4,42 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | -**RequesterEmailAddress** | **string** | The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. | -**Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**FileUrls** | **List<string>** | 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] -**AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [optional] [default to true] -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**AllowReassign** | **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] [default to false] -**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] -**CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] -**CustomFields** | [**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. | [optional] -**EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] -**FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] -**ForceSignerPage** | **bool** | Provide users the ability to review/edit the signers. | [optional] [default to false] -**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the subject and message. | [optional] [default to false] -**FormFieldGroups** | [**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`. | [optional] -**FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] -**FormFieldsPerDocument** | [**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` | [optional] -**HideTextTags** | **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] [default to false] -**HoldRequest** | **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] [default to false] -**IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [optional] [default to false] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, 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. | [optional] -**RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] -**ShowPreview** | **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] -**ShowProgressStepper** | **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] [default to true] -**Signers** | [**List<SubUnclaimedDraftSigner>**](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **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] [default to false] -**Type** | **string** | 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] [default to TypeEnum.RequestSignature] -**UsePreexistingFields** | **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] [default to false] -**UseTextTags** | **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] [default to false] -**PopulateAutoFillFields** | **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] [default to false] -**ExpiresAt** | **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. | [optional] +**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | **RequesterEmailAddress** | **string** | The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. | **Files** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | 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] **AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [optional] [default to true]**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**AllowReassign** | **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] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] **CustomFields** | [**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. | [optional] **EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **ForceSignerPage** | **bool** | Provide users the ability to review/edit the signers. | [optional] [default to false]**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the subject and message. | [optional] [default to false]**FormFieldGroups** | [**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`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **FormFieldsPerDocument** | [**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` | [optional] **HideTextTags** | **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] [default to false]**HoldRequest** | **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] [default to false]**IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, 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. | [optional] **RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] **ShowPreview** | **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] **ShowProgressStepper** | **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] [default to true]**Signers** | [**List<SubUnclaimedDraftSigner>**](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false]**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **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] [default to false]**Type** | **string** | 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] [default to TypeEnum.RequestSignature]**UsePreexistingFields** | **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] [default to false]**UseTextTags** | **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] [default to false]**PopulateAutoFillFields** | **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] [default to false]**ExpiresAt** | **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. | [optional] [[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 1dc85f6..d5b6954 100644 --- a/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md +++ b/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md @@ -4,36 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | -**RequesterEmailAddress** | **string** | The email address of the user that should be designated as the requester of this draft. | -**TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. | -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**AllowReassign** | **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] [default to false] -**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] -**CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] -**EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] -**FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] -**Files** | **List<System.IO.Stream>** | 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] -**FileUrls** | **List<string>** | 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] -**ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false] -**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false] -**HoldRequest** | **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] [default to false] -**IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [optional] [default to false] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, 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. | [optional] -**PreviewOnly** | **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] [default to false] -**RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] -**ShowPreview** | **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] [default to false] -**ShowProgressStepper** | **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] [default to true] -**Signers** | [**List<SubUnclaimedDraftTemplateSigner>**](SubUnclaimedDraftTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **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] [default to false] -**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] -**PopulateAutoFillFields** | **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] [default to false] -**AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [optional] [default to false] +**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | **RequesterEmailAddress** | **string** | The email address of the user that should be designated as the requester of this draft. | **TemplateIds** | **List<string>** | Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. | **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**AllowReassign** | **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] [default to false]**Ccs** | [**List<SubCC>**](SubCC.md) | Add CC email recipients. Required when a CC role exists for the Template. | [optional] **CustomFields** | [**List<SubCustomField>**](SubCustomField.md) | An array defining values and options for custom fields. Required when a custom field exists in the Template. | [optional] **EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **Files** | **List<System.IO.Stream>** | 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] **FileUrls** | **List<string>** | 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] **ForceSignerRoles** | **bool** | Provide users the ability to review/edit the template signer roles. | [optional] [default to false]**ForceSubjectMessage** | **bool** | Provide users the ability to review/edit the template subject and message. | [optional] [default to false]**HoldRequest** | **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] [default to false]**IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. | [optional] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, 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. | [optional] **PreviewOnly** | **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] [default to false]**RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] **ShowPreview** | **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] [default to false]**ShowProgressStepper** | **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] [default to true]**Signers** | [**List<SubUnclaimedDraftTemplateSigner>**](SubUnclaimedDraftTemplateSigner.md) | Add Signers to your Templated-based Signature Request. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **SkipMeNow** | **bool** | Disables the "Me (Now)" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. | [optional] [default to false]**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **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] [default to false]**Title** | **string** | The title you want to assign to the SignatureRequest. | [optional] **PopulateAutoFillFields** | **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] [default to false]**AllowCcs** | **bool** | This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. | [optional] [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 71ef91f..462e914 100644 --- a/docs/UnclaimedDraftCreateRequest.md +++ b/docs/UnclaimedDraftCreateRequest.md @@ -4,30 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | 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** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] -**FileUrls** | **List<string>** | 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] -**AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false] -**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] -**CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] -**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | [optional] -**CustomFields** | [**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. | [optional] -**FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] -**FormFieldGroups** | [**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`. | [optional] -**FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] -**FormFieldsPerDocument** | [**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` | [optional] -**HideTextTags** | **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] [default to false] -**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] -**Metadata** | **Dictionary<string, 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. | [optional] -**ShowProgressStepper** | **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] [default to true] -**Signers** | [**List<SubUnclaimedDraftSigner>**](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | [optional] -**SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] -**TestMode** | **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] [default to false] -**UsePreexistingFields** | **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] [default to false] -**UseTextTags** | **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] [default to false] -**ExpiresAt** | **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. | [optional] +**Type** | **string** | 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** | **List<System.IO.Stream>** | Use `files[]` to indicate the uploaded file(s) to send for signature.

This endpoint requires either **files** or **file_urls[]**, but not both. | [optional] **FileUrls** | **List<string>** | 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] **AllowDecline** | **bool** | Allows signers to decline to sign a document if `true`. Defaults to `false`. | [optional] [default to false]**Attachments** | [**List<SubAttachment>**](SubAttachment.md) | A list describing the attachments | [optional] **CcEmailAddresses** | **List<string>** | The email addresses that should be CCed. | [optional] **ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | [optional] **CustomFields** | [**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. | [optional] **FieldOptions** | [**SubFieldOptions**](SubFieldOptions.md) | | [optional] **FormFieldGroups** | [**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`. | [optional] **FormFieldRules** | [**List<SubFormFieldRule>**](SubFormFieldRule.md) | Conditional Logic rules for fields defined in `form_fields_per_document`. | [optional] **FormFieldsPerDocument** | [**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` | [optional] **HideTextTags** | **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] [default to false]**Message** | **string** | The custom message in the email that will be sent to the signers. | [optional] **Metadata** | **Dictionary<string, 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. | [optional] **ShowProgressStepper** | **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] [default to true]**Signers** | [**List<SubUnclaimedDraftSigner>**](SubUnclaimedDraftSigner.md) | Add Signers to your Unclaimed Draft Signature Request. | [optional] **SigningOptions** | [**SubSigningOptions**](SubSigningOptions.md) | | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **Subject** | **string** | The subject in the email that will be sent to the signers. | [optional] **TestMode** | **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] [default to false]**UsePreexistingFields** | **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] [default to false]**UseTextTags** | **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] [default to false]**ExpiresAt** | **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. | [optional] [[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 3258481..97a8f57 100644 --- a/docs/UnclaimedDraftCreateResponse.md +++ b/docs/UnclaimedDraftCreateResponse.md @@ -4,8 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**UnclaimedDraft** | [**UnclaimedDraftResponse**](UnclaimedDraftResponse.md) | | [optional] -**Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] +**UnclaimedDraft** | [**UnclaimedDraftResponse**](UnclaimedDraftResponse.md) | | **Warnings** | [**List<WarningResponse>**](WarningResponse.md) | A list of warnings. | [optional] [[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 80051e3..330a064 100644 --- a/docs/UnclaimedDraftEditAndResendRequest.md +++ b/docs/UnclaimedDraftEditAndResendRequest.md @@ -4,14 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | -**EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] -**IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. | [optional] -**RequesterEmailAddress** | **string** | 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] -**RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] -**ShowProgressStepper** | **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] [default to true] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**TestMode** | **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] [default to false] +**ClientId** | **string** | Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. | **EditorOptions** | [**SubEditorOptions**](SubEditorOptions.md) | | [optional] **IsForEmbeddedSigning** | **bool** | The request created from this draft will also be signable in embedded mode if set to `true`. | [optional] **RequesterEmailAddress** | **string** | 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] **RequestingRedirectUrl** | **string** | The URL you want signers redirected to after they successfully request a signature. | [optional] **ShowProgressStepper** | **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] [default to true]**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **TestMode** | **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] [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 d9fe7da..f301ff7 100644 --- a/docs/UnclaimedDraftResponse.md +++ b/docs/UnclaimedDraftResponse.md @@ -5,12 +5,7 @@ A group of documents that a user can take ownership of via the claim URL. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SignatureRequestId** | **string** | The ID of the signature request that is represented by this UnclaimedDraft. | [optional] -**ClaimUrl** | **string** | The URL to be used to claim this UnclaimedDraft. | [optional] -**SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] -**RequestingRedirectUrl** | **string** | 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] -**ExpiresAt** | **int?** | When the link expires. | [optional] -**TestMode** | **bool** | Whether this is a test draft. Signature requests made from test drafts have no legal value. | [optional] +**SignatureRequestId** | **string** | The ID of the signature request that is represented by this UnclaimedDraft. | [optional] **ClaimUrl** | **string** | The URL to be used to claim this UnclaimedDraft. | [optional] **SigningRedirectUrl** | **string** | The URL you want signers redirected to after they successfully sign. | [optional] **RequestingRedirectUrl** | **string** | 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] **ExpiresAt** | **int?** | When the link expires. | [optional] **TestMode** | **bool** | Whether this is a test draft. Signature requests made from test drafts have no legal value. | [optional] [[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 e5466e0..f44da16 100644 --- a/docs/WarningResponse.md +++ b/docs/WarningResponse.md @@ -5,8 +5,7 @@ A list of warnings. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**WarningMsg** | **string** | Warning message | -**WarningName** | **string** | Warning name | +**WarningMsg** | **string** | Warning message | **WarningName** | **string** | 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/examples/FaxLineAddUser.cs b/examples/FaxLineAddUser.cs new file mode 100644 index 0000000..de22f45 --- /dev/null +++ b/examples/FaxLineAddUser.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + var data = new FaxLineAddUserRequest( + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com" + ); + + try + { + var result = faxLineApi.FaxLineAddUser(data); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineAreaCodeGet.cs b/examples/FaxLineAreaCodeGet.cs new file mode 100644 index 0000000..3beedfe --- /dev/null +++ b/examples/FaxLineAreaCodeGet.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineAreaCodeGet("US", "CA"); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineCreate.cs b/examples/FaxLineCreate.cs new file mode 100644 index 0000000..4d96ae5 --- /dev/null +++ b/examples/FaxLineCreate.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + var data = new FaxLineCreateRequest( + areaCode: 209, + country: "US" + ); + + try + { + var result = faxLineApi.FaxLineCreate(data); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineDelete.cs b/examples/FaxLineDelete.cs new file mode 100644 index 0000000..a2cf8a9 --- /dev/null +++ b/examples/FaxLineDelete.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + var data = new FaxLineDeleteRequest( + number: "[FAX_NUMBER]", + ); + + try + { + faxLineApi.FaxLineDelete(data); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineGet.cs b/examples/FaxLineGet.cs new file mode 100644 index 0000000..d18c82f --- /dev/null +++ b/examples/FaxLineGet.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineGet("[FAX_NUMBER]"); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineList.cs b/examples/FaxLineList.cs new file mode 100644 index 0000000..96d7f0c --- /dev/null +++ b/examples/FaxLineList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + try + { + var result = faxLineApi.FaxLineList(); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/examples/FaxLineRemoveUser.cs b/examples/FaxLineRemoveUser.cs new file mode 100644 index 0000000..1dd562e --- /dev/null +++ b/examples/FaxLineRemoveUser.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Dropbox.Sign.Api; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +public class Example +{ + public static void Main() + { + var config = new Configuration(); + config.Username = "YOUR_API_KEY"; + + var faxLineApi = new FaxLineApi(config); + + var data = new FaxLineRemoveUserRequest( + number: "[FAX_NUMBER]", + emailAddress: "member@dropboxsign.com" + ); + + try + { + var result = faxLineApi.FaxLineRemoveUser(data); + Console.WriteLine(result); + } + catch (ApiException e) + { + Console.WriteLine("Exception when calling Dropbox Sign API: " + e.Message); + Console.WriteLine("Status Code: " + e.ErrorCode); + Console.WriteLine(e.StackTrace); + } + } +} diff --git a/openapi-config.yaml b/openapi-config.yaml index 1d76c9a..f87cb23 100644 --- a/openapi-config.yaml +++ b/openapi-config.yaml @@ -1,16 +1,19 @@ -generatorName: csharp-netcore +generatorName: csharp additionalProperties: - clientPackage: Dropbox.Sign.Api + clientPackage: Client packageName: Dropbox.Sign packageAuthors: Dropbox Sign API Team packageCompany: Dropbox Sign API Team + packageCopyright: Dropbox 2024 packageDescription: Client library for using the Dropbox Sign API - packageVersion: 1.5.0 + packageVersion: 1.6.0 packageTitle: Dropbox Sign .Net SDK sortModelPropertiesByRequiredFlag: true optionalEmitDefaultValues: true targetFramework: net6.0 packageGuid: "{F8C8232D-7020-4603-8E04-18D060AE530B}" + legacyDiscriminatorBehavior: true + useCustomTemplateCode: true files: EventCallbackHelper.cs: templateType: SupportingFiles 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/run-build b/run-build index 01f458f..d928df3 100755 --- a/run-build +++ b/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/522a5df24ab2424dcd6e4e28393000045e3ea39e/modules/openapi-generator/src/main/resources/csharp-netcore +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.8.0/modules/openapi-generator/src/main/resources/csharp set -e @@ -9,7 +9,7 @@ WORKING_DIR="/app/dotnet" docker run --rm \ -v "${DIR}/:/local" \ - openapitools/openapi-generator-cli:v6.0.0 generate \ + openapitools/openapi-generator-cli:v7.8.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ @@ -48,3 +48,4 @@ printf "Running tests ...\n" bash "${DIR}/bin/dotnet" dotnet test src/Dropbox.Sign.Test/ printf "Success!\n" + diff --git a/src/Dropbox.Sign.Test/Api/ApiAppApiTests.cs b/src/Dropbox.Sign.Test/Api/ApiAppApiTests.cs index e9a3e63..a205334 100644 --- a/src/Dropbox.Sign.Test/Api/ApiAppApiTests.cs +++ b/src/Dropbox.Sign.Test/Api/ApiAppApiTests.cs @@ -43,7 +43,7 @@ public void ApiAppGetTest() TestHelper.AssertJsonSame(responseData.ToString(), response.ToJson()); } - [Fact(Skip="DELETE /api_app/{client_id} skipped")] + [Fact(Skip = "DELETE /api_app/{client_id} skipped")] public void ApiAppDeleteTest() { } @@ -83,39 +83,5 @@ public void ApiAppUpdateTest() TestHelper.AssertJsonSame(responseData.ToString(), response.ToJson()); } - - [Fact] - public void ValuesJsonifiedTest() - { - var oauth = new SubOAuth( - callbackUrl: "https://oauth-callback.test", - scopes: new List() {SubOAuth.ScopesEnum.TemplateAccess} - ); - - var customLogoFile = TestHelper.GetFile("pdf-sample.pdf"); - - var obj = new ApiAppCreateRequest( - name: "My name is", - callbackUrl: "https://awesome.test", - domains: new List() {"domain1.com", "domain2.com"}, - oauth: oauth, - customLogoFile: customLogoFile - ); - - var responseData = TestHelper.GetJsonContents(nameof(ApiAppGetResponse)); - - var responseObj = ApiAppGetResponse.Init(responseData.ToString()); - - var api = MockRestClientHelper.CreateApiExpectContentContains(responseObj, - HttpStatusCode.Accepted, - "application/json", - "[\"domain1.com\",\"domain2.com\"]", - "My name is", - "{\"scopes\":[\"template_access\"],\"callback_url\":\"https://oauth-callback.test\"}" - ); - var response = api.ApiAppCreate(obj); - - TestHelper.AssertJsonSame(responseData.ToString(), response.ToJson()); - } } } diff --git a/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj b/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj index 67bb761..50c2bf7 100644 --- a/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj +++ b/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/src/Dropbox.Sign.Test/MockRestClientHelper.cs b/src/Dropbox.Sign.Test/MockRestClientHelper.cs index 6143196..5e9ed02 100644 --- a/src/Dropbox.Sign.Test/MockRestClientHelper.cs +++ b/src/Dropbox.Sign.Test/MockRestClientHelper.cs @@ -1,13 +1,19 @@ using System; +using System.Globalization; using System.IO; using System.Linq; using System.Net; using System.Net.Http; +using System.Text.RegularExpressions; using Dropbox.Sign.Client; +using Dropbox.Sign.Model; using RestSharp; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using Newtonsoft.Json.Serialization; +using RestSharp.Serializers; using RichardSzalay.MockHttp; +using FileIO = System.IO.File; namespace Dropbox.Sign.Test { @@ -76,11 +82,158 @@ private static T CreateApiInternal(MockHttpMessageHandler handler) ConfigureMessageHandler = _ => handler, BaseUrl = new Uri("https://api.hellosign.com") }; - var mockRestClient = new RestClient(options); + var mockRestClient = new RestClient(options, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, GlobalConfiguration.Instance)) + ); + Configuration config = new Configuration(); config.Username = "YOUR_API_KEY"; var client = new ApiClient(config.BasePath, mockRestClient); return (T)Activator.CreateInstance(typeof(T), client, client, config); } + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + private static JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + } + + // see ApiClient::CustomJsonCodec + internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer + { + private readonly IReadableConfiguration _configuration; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return ((AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value); + + public T Deserialize(RestResponse response) + { + var result = (T)Deserialize(response, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The HTTP response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(RestResponse response, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return response.RawBytes; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + var bytes = response.RawBytes; + if (response.Headers != null) + { + var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) + ? Path.GetTempPath() + : _configuration.TempFolderPath; + var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in response.Headers) + { + var match = regex.Match(header.ToString()); + if (match.Success) + { + string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + FileIO.WriteAllBytes(fileName, bytes); + return new FileStream(fileName, FileMode.Open); + } + } + } + var stream = new MemoryStream(bytes); + return stream; + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(response.Content, type); + } + + // at this point, it must be a model (json) + try + { + return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings); + } + catch (Exception e) + { + throw new ApiException(500, e.Message); + } + } + + public ISerializer Serializer => this; + public IDeserializer Deserializer => this; + + public string[] AcceptedContentTypes => ContentType.JsonAccept; + + public SupportsContentType SupportsContentType => contentType => + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + + public ContentType ContentType { get; set; } = ContentType.Json; + + public DataFormat DataFormat => DataFormat.Json; } } diff --git a/src/Dropbox.Sign/Api/AccountApi.cs b/src/Dropbox.Sign/Api/AccountApi.cs index 0b1d311..0e70ee2 100644 --- a/src/Dropbox.Sign/Api/AccountApi.cs +++ b/src/Dropbox.Sign/Api/AccountApi.cs @@ -141,7 +141,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountCreateResponse - System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Account @@ -154,7 +154,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountCreateResponse) - System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Account /// @@ -167,7 +167,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - System.Threading.Tasks.Task AccountGetAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountGetAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Account @@ -181,7 +181,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Account /// @@ -193,7 +193,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Account @@ -206,7 +206,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Verify Account /// @@ -218,7 +218,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountVerifyResponse - System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Verify Account @@ -231,7 +231,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountVerifyResponse) - System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -411,6 +411,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -449,7 +450,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountCreateResponse - public async System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountCreateWithHttpInfoAsync(accountCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -463,7 +464,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountCreateResponse) - public async System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'accountCreateRequest' is set if (accountCreateRequest == null) @@ -503,6 +504,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -588,6 +590,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "email_address", emailAddress)); } + localVarRequestOptions.Operation = "AccountApi.AccountGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -627,7 +630,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - public async System.Threading.Tasks.Task AccountGetAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountGetAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountGetWithHttpInfoAsync(accountId, emailAddress, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -642,14 +645,13 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - public async System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -676,6 +678,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "email_address", emailAddress)); } + localVarRequestOptions.Operation = "AccountApi.AccountGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -766,6 +769,7 @@ public Dropbox.Sign.Client.ApiResponse AccountUpdateWithHttp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountUpdate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -804,7 +808,7 @@ public Dropbox.Sign.Client.ApiResponse AccountUpdateWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - public async System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountUpdateWithHttpInfoAsync(accountUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -818,7 +822,7 @@ public Dropbox.Sign.Client.ApiResponse AccountUpdateWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - public async System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'accountUpdateRequest' is set if (accountUpdateRequest == null) @@ -858,6 +862,7 @@ public Dropbox.Sign.Client.ApiResponse AccountUpdateWithHttp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountUpdate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -948,6 +953,7 @@ public Dropbox.Sign.Client.ApiResponse AccountVerifyWithH localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountVerify"; localVarRequestOptions.OperationIndex = operationIndex; @@ -986,7 +992,7 @@ public Dropbox.Sign.Client.ApiResponse AccountVerifyWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountVerifyResponse - public async System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountVerifyWithHttpInfoAsync(accountVerifyRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1000,7 +1006,7 @@ public Dropbox.Sign.Client.ApiResponse AccountVerifyWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountVerifyResponse) - public async System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'accountVerifyRequest' is set if (accountVerifyRequest == null) @@ -1040,6 +1046,7 @@ public Dropbox.Sign.Client.ApiResponse AccountVerifyWithH localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "AccountApi.AccountVerify"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/src/Dropbox.Sign/Api/ApiAppApi.cs b/src/Dropbox.Sign/Api/ApiAppApi.cs index 4213670..d5ff438 100644 --- a/src/Dropbox.Sign/Api/ApiAppApi.cs +++ b/src/Dropbox.Sign/Api/ApiAppApi.cs @@ -166,7 +166,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create API App @@ -179,7 +179,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete API App /// @@ -191,7 +191,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete API App @@ -204,7 +204,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get API App /// @@ -216,7 +216,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get API App @@ -229,7 +229,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List API Apps /// @@ -242,7 +242,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppListResponse - System.Threading.Tasks.Task ApiAppListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List API Apps @@ -256,7 +256,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppListResponse) - System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update API App /// @@ -269,7 +269,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update API App @@ -283,7 +283,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -463,6 +463,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppCreateWithHttpIn localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "ApiAppApi.ApiAppCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -501,7 +502,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppCreateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - public async System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ApiAppCreateWithHttpInfoAsync(apiAppCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -515,7 +516,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppCreateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - public async System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'apiAppCreateRequest' is set if (apiAppCreateRequest == null) @@ -555,6 +556,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppCreateWithHttpIn localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "ApiAppApi.ApiAppCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -636,6 +638,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -674,7 +677,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await ApiAppDeleteWithHttpInfoAsync(clientId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -687,7 +690,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'clientId' is set if (clientId == null) @@ -700,7 +703,6 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -720,6 +722,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -802,6 +805,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -840,7 +844,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - public async System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ApiAppGetWithHttpInfoAsync(clientId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -854,7 +858,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - public async System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'clientId' is set if (clientId == null) @@ -867,7 +871,6 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -887,6 +890,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -972,6 +976,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "ApiAppApi.ApiAppList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1011,7 +1016,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppListResponse - public async System.Threading.Tasks.Task ApiAppListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ApiAppListWithHttpInfoAsync(page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1026,14 +1031,13 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppListResponse) - public async System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1060,6 +1064,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "ApiAppApi.ApiAppList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1159,6 +1164,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppUpdateWithHttpIn } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppUpdate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1198,7 +1204,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppUpdateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - public async System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ApiAppUpdateWithHttpInfoAsync(clientId, apiAppUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1213,7 +1219,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppUpdateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - public async System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'clientId' is set if (clientId == null) @@ -1260,6 +1266,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppUpdateWithHttpIn } localVarRequestOptions.PathParameters.Add("client_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(clientId)); // path parameter + localVarRequestOptions.Operation = "ApiAppApi.ApiAppUpdate"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/src/Dropbox.Sign/Api/BulkSendJobApi.cs b/src/Dropbox.Sign/Api/BulkSendJobApi.cs index f550e80..2591562 100644 --- a/src/Dropbox.Sign/Api/BulkSendJobApi.cs +++ b/src/Dropbox.Sign/Api/BulkSendJobApi.cs @@ -101,7 +101,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobGetResponse - System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Bulk Send Job @@ -116,7 +116,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobGetResponse) - System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Bulk Send Jobs /// @@ -129,7 +129,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobListResponse - System.Threading.Tasks.Task BulkSendJobListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task BulkSendJobListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Bulk Send Jobs @@ -143,7 +143,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobListResponse) - System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -327,6 +327,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "BulkSendJobApi.BulkSendJobGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -367,7 +368,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobGetResponse - public async System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await BulkSendJobGetWithHttpInfoAsync(bulkSendJobId, page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -383,7 +384,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobGetResponse) - public async System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'bulkSendJobId' is set if (bulkSendJobId == null) @@ -396,7 +397,6 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -424,6 +424,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "BulkSendJobApi.BulkSendJobGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -509,6 +510,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "BulkSendJobApi.BulkSendJobList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -548,7 +550,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobListResponse - public async System.Threading.Tasks.Task BulkSendJobListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task BulkSendJobListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await BulkSendJobListWithHttpInfoAsync(page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -563,14 +565,13 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobListResponse) - public async System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -597,6 +598,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "BulkSendJobApi.BulkSendJobList"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/src/Dropbox.Sign/Api/EmbeddedApi.cs b/src/Dropbox.Sign/Api/EmbeddedApi.cs index da3f9e0..32115b2 100644 --- a/src/Dropbox.Sign/Api/EmbeddedApi.cs +++ b/src/Dropbox.Sign/Api/EmbeddedApi.cs @@ -96,7 +96,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedEditUrlResponse - System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Embedded Template Edit URL @@ -110,7 +110,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedEditUrlResponse) - System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Embedded Sign URL /// @@ -122,7 +122,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedSignUrlResponse - System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Embedded Sign URL @@ -135,7 +135,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedSignUrlResponse) - System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -324,6 +324,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedEditUrlW } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "EmbeddedApi.EmbeddedEditUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -363,7 +364,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedEditUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedEditUrlResponse - public async System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await EmbeddedEditUrlWithHttpInfoAsync(templateId, embeddedEditUrlRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -378,7 +379,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedEditUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedEditUrlResponse) - public async System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -425,6 +426,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedEditUrlW } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "EmbeddedApi.EmbeddedEditUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -507,6 +509,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW } localVarRequestOptions.PathParameters.Add("signature_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureId)); // path parameter + localVarRequestOptions.Operation = "EmbeddedApi.EmbeddedSignUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -545,7 +548,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedSignUrlResponse - public async System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await EmbeddedSignUrlWithHttpInfoAsync(signatureId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -559,7 +562,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedSignUrlResponse) - public async System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureId' is set if (signatureId == null) @@ -572,7 +575,6 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -592,6 +594,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW } localVarRequestOptions.PathParameters.Add("signature_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureId)); // path parameter + localVarRequestOptions.Operation = "EmbeddedApi.EmbeddedSignUrl"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/src/Dropbox.Sign/Api/FaxLineApi.cs b/src/Dropbox.Sign/Api/FaxLineApi.cs new file mode 100644 index 0000000..edb0eb5 --- /dev/null +++ b/src/Dropbox.Sign/Api/FaxLineApi.cs @@ -0,0 +1,1740 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Dropbox.Sign.Client; +using Dropbox.Sign.Model; + +namespace Dropbox.Sign.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFaxLineApiSync : IApiAccessor + { + #region Synchronous Operations + /// + /// Add Fax Line User + /// + /// + /// Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + FaxLineResponse FaxLineAddUser(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0); + + /// + /// Add Fax Line User + /// + /// + /// Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + ApiResponse FaxLineAddUserWithHttpInfo(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0); + /// + /// Get Available Fax Line Area Codes + /// + /// + /// Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// FaxLineAreaCodeGetResponse + FaxLineAreaCodeGetResponse FaxLineAreaCodeGet(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0); + + /// + /// Get Available Fax Line Area Codes + /// + /// + /// Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// ApiResponse of FaxLineAreaCodeGetResponse + ApiResponse FaxLineAreaCodeGetWithHttpInfo(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0); + /// + /// Purchase Fax Line + /// + /// + /// Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + FaxLineResponse FaxLineCreate(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0); + + /// + /// Purchase Fax Line + /// + /// + /// Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + ApiResponse FaxLineCreateWithHttpInfo(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0); + /// + /// Delete Fax Line + /// + /// + /// Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// + void FaxLineDelete(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0); + + /// + /// Delete Fax Line + /// + /// + /// Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + ApiResponse FaxLineDeleteWithHttpInfo(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0); + /// + /// Get Fax Line + /// + /// + /// Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// FaxLineResponse + FaxLineResponse FaxLineGet(string number, int operationIndex = 0); + + /// + /// Get Fax Line + /// + /// + /// Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + ApiResponse FaxLineGetWithHttpInfo(string number, int operationIndex = 0); + /// + /// List Fax Lines + /// + /// + /// Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// FaxLineListResponse + FaxLineListResponse FaxLineList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0); + + /// + /// List Fax Lines + /// + /// + /// Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// ApiResponse of FaxLineListResponse + ApiResponse FaxLineListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0); + /// + /// Remove Fax Line Access + /// + /// + /// Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + FaxLineResponse FaxLineRemoveUser(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0); + + /// + /// Remove Fax Line Access + /// + /// + /// Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + ApiResponse FaxLineRemoveUserWithHttpInfo(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0); + #endregion Synchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFaxLineApiAsync : IApiAccessor + { + #region Asynchronous Operations + /// + /// Add Fax Line User + /// + /// + /// Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + System.Threading.Tasks.Task FaxLineAddUserAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Add Fax Line User + /// + /// + /// Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + System.Threading.Tasks.Task> FaxLineAddUserWithHttpInfoAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get Available Fax Line Area Codes + /// + /// + /// Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineAreaCodeGetResponse + System.Threading.Tasks.Task FaxLineAreaCodeGetAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get Available Fax Line Area Codes + /// + /// + /// Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineAreaCodeGetResponse) + System.Threading.Tasks.Task> FaxLineAreaCodeGetWithHttpInfoAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Purchase Fax Line + /// + /// + /// Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + System.Threading.Tasks.Task FaxLineCreateAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Purchase Fax Line + /// + /// + /// Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + System.Threading.Tasks.Task> FaxLineCreateWithHttpInfoAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Delete Fax Line + /// + /// + /// Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + System.Threading.Tasks.Task FaxLineDeleteAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Delete Fax Line + /// + /// + /// Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + System.Threading.Tasks.Task> FaxLineDeleteWithHttpInfoAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Get Fax Line + /// + /// + /// Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + System.Threading.Tasks.Task FaxLineGetAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get Fax Line + /// + /// + /// Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + System.Threading.Tasks.Task> FaxLineGetWithHttpInfoAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// List Fax Lines + /// + /// + /// Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineListResponse + System.Threading.Tasks.Task FaxLineListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// List Fax Lines + /// + /// + /// Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineListResponse) + System.Threading.Tasks.Task> FaxLineListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// + /// Remove Fax Line Access + /// + /// + /// Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + System.Threading.Tasks.Task FaxLineRemoveUserAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Remove Fax Line Access + /// + /// + /// Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + System.Threading.Tasks.Task> FaxLineRemoveUserWithHttpInfoAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + #endregion Asynchronous Operations + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public interface IFaxLineApi : IFaxLineApiSync, IFaxLineApiAsync + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class FaxLineApi : IFaxLineApi + { + private Dropbox.Sign.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// + /// + public FaxLineApi() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + public FaxLineApi(string basePath) + { + this.Configuration = Dropbox.Sign.Client.Configuration.MergeConfigurations( + Dropbox.Sign.Client.GlobalConfiguration.Instance, + new Dropbox.Sign.Client.Configuration { BasePath = basePath } + ); + this.Client = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + this.ExceptionFactory = Dropbox.Sign.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public FaxLineApi(Dropbox.Sign.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = Dropbox.Sign.Client.Configuration.MergeConfigurations( + Dropbox.Sign.Client.GlobalConfiguration.Instance, + configuration + ); + this.Client = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + this.AsynchronousClient = new Dropbox.Sign.Client.ApiClient(this.Configuration.BasePath); + ExceptionFactory = Dropbox.Sign.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access. + /// The client interface for asynchronous API access. + /// The configuration object. + public FaxLineApi(Dropbox.Sign.Client.ISynchronousClient client, Dropbox.Sign.Client.IAsynchronousClient asyncClient, Dropbox.Sign.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + this.AsynchronousClient = asyncClient; + this.Configuration = configuration; + this.ExceptionFactory = Dropbox.Sign.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// The client for accessing this underlying API asynchronously. + /// + public Dropbox.Sign.Client.IAsynchronousClient AsynchronousClient { get; set; } + + /// + /// The client for accessing this underlying API synchronously. + /// + public Dropbox.Sign.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Dropbox.Sign.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + /// + /// Add Fax Line User Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + public FaxLineResponse FaxLineAddUser(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineAddUserWithHttpInfo(faxLineAddUserRequest); + return localVarResponse.Data; + } + + /// + /// Add Fax Line User Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpInfo(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0) + { + // verify the required parameter 'faxLineAddUserRequest' is set + if (faxLineAddUserRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineAddUserRequest' when calling FaxLineApi->FaxLineAddUser"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineAddUserRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineAddUserRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineAddUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/fax_line/add_user", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineAddUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Add Fax Line User Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + public async System.Threading.Tasks.Task FaxLineAddUserAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineAddUserWithHttpInfoAsync(faxLineAddUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Add Fax Line User Grants a user access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + public async System.Threading.Tasks.Task> FaxLineAddUserWithHttpInfoAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxLineAddUserRequest' is set + if (faxLineAddUserRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineAddUserRequest' when calling FaxLineApi->FaxLineAddUser"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineAddUserRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineAddUserRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineAddUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/fax_line/add_user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineAddUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// FaxLineAreaCodeGetResponse + public FaxLineAreaCodeGetResponse FaxLineAreaCodeGet(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineAreaCodeGetWithHttpInfo(country, state, province, city); + return localVarResponse.Data; + } + + /// + /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// ApiResponse of FaxLineAreaCodeGetResponse + public Dropbox.Sign.Client.ApiResponse FaxLineAreaCodeGetWithHttpInfo(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0) + { + // verify the required parameter 'country' is set + if (country == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'country' when calling FaxLineApi->FaxLineAreaCodeGet"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "country", country)); + if (state != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "state", state)); + } + if (province != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "province", province)); + } + if (city != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "city", city)); + } + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineAreaCodeGet"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/fax_line/area_codes", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineAreaCodeGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineAreaCodeGetResponse + public async System.Threading.Tasks.Task FaxLineAreaCodeGetAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineAreaCodeGetWithHttpInfoAsync(country, state, province, city, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Available Fax Line Area Codes Returns a response with the area codes available for a given state/provice and city. + /// + /// Thrown when fails to make API call + /// Filter area codes by country. + /// Filter area codes by state. (optional) + /// Filter area codes by province. (optional) + /// Filter area codes by city. (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineAreaCodeGetResponse) + public async System.Threading.Tasks.Task> FaxLineAreaCodeGetWithHttpInfoAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'country' is set + if (country == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'country' when calling FaxLineApi->FaxLineAreaCodeGet"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "country", country)); + if (state != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "state", state)); + } + if (province != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "province", province)); + } + if (city != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "city", city)); + } + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineAreaCodeGet"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/fax_line/area_codes", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineAreaCodeGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Purchase Fax Line Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + public FaxLineResponse FaxLineCreate(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineCreateWithHttpInfo(faxLineCreateRequest); + return localVarResponse.Data; + } + + /// + /// Purchase Fax Line Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + public Dropbox.Sign.Client.ApiResponse FaxLineCreateWithHttpInfo(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0) + { + // verify the required parameter 'faxLineCreateRequest' is set + if (faxLineCreateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineCreateRequest' when calling FaxLineApi->FaxLineCreate"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineCreateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineCreateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineCreate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Post("/fax_line/create", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Purchase Fax Line Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + public async System.Threading.Tasks.Task FaxLineCreateAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineCreateWithHttpInfoAsync(faxLineCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Purchase Fax Line Purchases a new Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + public async System.Threading.Tasks.Task> FaxLineCreateWithHttpInfoAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxLineCreateRequest' is set + if (faxLineCreateRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineCreateRequest' when calling FaxLineApi->FaxLineCreate"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineCreateRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineCreateRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineCreate"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PostAsync("/fax_line/create", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineCreate", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Fax Line Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// + public void FaxLineDelete(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0) + { + FaxLineDeleteWithHttpInfo(faxLineDeleteRequest); + } + + /// + /// Delete Fax Line Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of Object(void) + public Dropbox.Sign.Client.ApiResponse FaxLineDeleteWithHttpInfo(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0) + { + // verify the required parameter 'faxLineDeleteRequest' is set + if (faxLineDeleteRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineDeleteRequest' when calling FaxLineApi->FaxLineDelete"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineDeleteRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineDeleteRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineDelete"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Delete("/fax_line", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineDelete", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Delete Fax Line Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of void + public async System.Threading.Tasks.Task FaxLineDeleteAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + await FaxLineDeleteWithHttpInfoAsync(faxLineDeleteRequest, operationIndex, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete Fax Line Deletes the specified Fax Line from the subscription. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse + public async System.Threading.Tasks.Task> FaxLineDeleteWithHttpInfoAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxLineDeleteRequest' is set + if (faxLineDeleteRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineDeleteRequest' when calling FaxLineApi->FaxLineDelete"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineDeleteRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineDeleteRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineDelete"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.DeleteAsync("/fax_line", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineDelete", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Fax Line Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// FaxLineResponse + public FaxLineResponse FaxLineGet(string number, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineGetWithHttpInfo(number); + return localVarResponse.Data; + } + + /// + /// Get Fax Line Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(string number, int operationIndex = 0) + { + // verify the required parameter 'number' is set + if (number == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'number' when calling FaxLineApi->FaxLineGet"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "number", number)); + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineGet"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/fax_line", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Get Fax Line Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + public async System.Threading.Tasks.Task FaxLineGetAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineGetWithHttpInfoAsync(number, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Get Fax Line Returns the properties and settings of a Fax Line. + /// + /// Thrown when fails to make API call + /// The Fax Line number. + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + public async System.Threading.Tasks.Task> FaxLineGetWithHttpInfoAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'number' is set + if (number == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'number' when calling FaxLineApi->FaxLineGet"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "number", number)); + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineGet"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/fax_line", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Fax Lines Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// FaxLineListResponse + public FaxLineListResponse FaxLineList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); + return localVarResponse.Data; + } + + /// + /// List Fax Lines Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// ApiResponse of FaxLineListResponse + public Dropbox.Sign.Client.ApiResponse FaxLineListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0) + { + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (accountId != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "account_id", accountId)); + } + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (pageSize != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); + } + if (showTeamLines != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "show_team_lines", showTeamLines)); + } + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineList"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/fax_line/list", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineList", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// List Fax Lines Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineListResponse + public async System.Threading.Tasks.Task FaxLineListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineListWithHttpInfoAsync(accountId, page, pageSize, showTeamLines, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// List Fax Lines Returns the properties and settings of multiple Fax Lines. + /// + /// Thrown when fails to make API call + /// Account ID (optional) + /// Page (optional, default to 1) + /// Page size (optional, default to 20) + /// Show team lines (optional) + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineListResponse) + public async System.Threading.Tasks.Task> FaxLineListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + if (accountId != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "account_id", accountId)); + } + if (page != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page", page)); + } + if (pageSize != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); + } + if (showTeamLines != null) + { + localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "show_team_lines", showTeamLines)); + } + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineList"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.GetAsync("/fax_line/list", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineList", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// FaxLineResponse + public FaxLineResponse FaxLineRemoveUser(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineRemoveUserWithHttpInfo(faxLineRemoveUserRequest); + return localVarResponse.Data; + } + + /// + /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// ApiResponse of FaxLineResponse + public Dropbox.Sign.Client.ApiResponse FaxLineRemoveUserWithHttpInfo(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0) + { + // verify the required parameter 'faxLineRemoveUserRequest' is set + if (faxLineRemoveUserRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineRemoveUserRequest' when calling FaxLineApi->FaxLineRemoveUser"); + } + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineRemoveUserRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineRemoveUserRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineRemoveUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = this.Client.Put("/fax_line/remove_user", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineRemoveUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of FaxLineResponse + public async System.Threading.Tasks.Task FaxLineRemoveUserAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineRemoveUserWithHttpInfoAsync(faxLineRemoveUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// Remove Fax Line Access Removes a user's access to the specified Fax Line. + /// + /// Thrown when fails to make API call + /// + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (FaxLineResponse) + public async System.Threading.Tasks.Task> FaxLineRemoveUserWithHttpInfoAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + // verify the required parameter 'faxLineRemoveUserRequest' is set + if (faxLineRemoveUserRequest == null) + { + throw new Dropbox.Sign.Client.ApiException(400, "Missing required parameter 'faxLineRemoveUserRequest' when calling FaxLineApi->FaxLineRemoveUser"); + } + + + Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); + + var localVarContentType = ""; + var openApiTypes = faxLineRemoveUserRequest.GetOpenApiTypes(); + if (ClientUtils.HasFileType(openApiTypes)) + { + ClientUtils.SetFormData(localVarRequestOptions, openApiTypes); + localVarContentType = "multipart/form-data"; + } + else + { + localVarContentType = "application/json"; + localVarRequestOptions.Data = faxLineRemoveUserRequest; + } + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + if (localVarContentType != null) + { + localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + } + + var localVarAccept = Dropbox.Sign.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) + { + localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + } + + + localVarRequestOptions.Operation = "FaxLineApi.FaxLineRemoveUser"; + localVarRequestOptions.OperationIndex = operationIndex; + + // authentication (api_key) required + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + Dropbox.Sign.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + + // make the HTTP request + var localVarResponse = await this.AsynchronousClient.PutAsync("/fax_line/remove_user", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("FaxLineRemoveUser", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + } +} diff --git a/src/Dropbox.Sign/Api/OAuthApi.cs b/src/Dropbox.Sign/Api/OAuthApi.cs index 78d47c5..563c0a5 100644 --- a/src/Dropbox.Sign/Api/OAuthApi.cs +++ b/src/Dropbox.Sign/Api/OAuthApi.cs @@ -93,7 +93,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// OAuth Token Generate @@ -106,7 +106,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// OAuth Token Refresh /// @@ -118,7 +118,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// OAuth Token Refresh @@ -131,7 +131,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -311,6 +311,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenGenerateWit localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "OAuthApi.OauthTokenGenerate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -337,7 +338,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenGenerateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - public async System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await OauthTokenGenerateWithHttpInfoAsync(oAuthTokenGenerateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -351,7 +352,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenGenerateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - public async System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'oAuthTokenGenerateRequest' is set if (oAuthTokenGenerateRequest == null) @@ -391,6 +392,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenGenerateWit localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "OAuthApi.OauthTokenGenerate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -469,6 +471,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenRefreshWith localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "OAuthApi.OauthTokenRefresh"; localVarRequestOptions.OperationIndex = operationIndex; @@ -495,7 +498,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenRefreshWith /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - public async System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await OauthTokenRefreshWithHttpInfoAsync(oAuthTokenRefreshRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -509,7 +512,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenRefreshWith /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - public async System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'oAuthTokenRefreshRequest' is set if (oAuthTokenRefreshRequest == null) @@ -549,6 +552,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenRefreshWith localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "OAuthApi.OauthTokenRefresh"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/src/Dropbox.Sign/Api/ReportApi.cs b/src/Dropbox.Sign/Api/ReportApi.cs index 8f8a81b..a3e2693 100644 --- a/src/Dropbox.Sign/Api/ReportApi.cs +++ b/src/Dropbox.Sign/Api/ReportApi.cs @@ -70,7 +70,7 @@ public interface IReportApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ReportCreateResponse - System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Report @@ -83,7 +83,7 @@ public interface IReportApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ReportCreateResponse) - System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -263,6 +263,7 @@ public Dropbox.Sign.Client.ApiResponse ReportCreateWithHtt localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "ReportApi.ReportCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -295,7 +296,7 @@ public Dropbox.Sign.Client.ApiResponse ReportCreateWithHtt /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ReportCreateResponse - public async System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ReportCreateWithHttpInfoAsync(reportCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -309,7 +310,7 @@ public Dropbox.Sign.Client.ApiResponse ReportCreateWithHtt /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ReportCreateResponse) - public async System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'reportCreateRequest' is set if (reportCreateRequest == null) @@ -349,6 +350,7 @@ public Dropbox.Sign.Client.ApiResponse ReportCreateWithHtt localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "ReportApi.ReportCreate"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/src/Dropbox.Sign/Api/SignatureRequestApi.cs b/src/Dropbox.Sign/Api/SignatureRequestApi.cs index 1ccec7f..0669f91 100644 --- a/src/Dropbox.Sign/Api/SignatureRequestApi.cs +++ b/src/Dropbox.Sign/Api/SignatureRequestApi.cs @@ -429,7 +429,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Embedded Bulk Send with Template @@ -442,7 +442,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Bulk Send with Template /// @@ -454,7 +454,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Bulk Send with Template @@ -467,7 +467,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Cancel Incomplete Signature Request /// @@ -479,7 +479,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Cancel Incomplete Signature Request @@ -492,7 +492,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Signature Request /// @@ -504,7 +504,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Signature Request @@ -517,7 +517,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Signature Request with Template /// @@ -529,7 +529,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Signature Request with Template @@ -542,7 +542,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files /// @@ -555,7 +555,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files @@ -569,7 +569,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files as Data Uri /// @@ -581,7 +581,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files as Data Uri @@ -594,7 +594,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files as File Url /// @@ -607,7 +607,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Download Files as File Url @@ -621,7 +621,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Signature Request /// @@ -633,7 +633,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Signature Request @@ -646,7 +646,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Signature Requests /// @@ -661,7 +661,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestListResponse - System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Signature Requests @@ -677,7 +677,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestListResponse) - System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Release On-Hold Signature Request /// @@ -689,7 +689,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Release On-Hold Signature Request @@ -702,7 +702,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send Request Reminder /// @@ -715,7 +715,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send Request Reminder @@ -729,7 +729,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove Signature Request Access /// @@ -741,7 +741,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove Signature Request Access @@ -754,7 +754,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send Signature Request /// @@ -766,7 +766,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send Signature Request @@ -779,7 +779,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send with Template /// @@ -791,7 +791,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Send with Template @@ -804,7 +804,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Signature Request /// @@ -817,7 +817,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Signature Request @@ -831,7 +831,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -1011,6 +1011,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestBulkCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1043,7 +1044,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - public async System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(signatureRequestBulkCreateEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1057,7 +1058,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - public async System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' is set if (signatureRequestBulkCreateEmbeddedWithTemplateRequest == null) @@ -1097,6 +1098,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestBulkCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1181,6 +1183,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestBulkSendWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1219,7 +1222,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - public async System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(signatureRequestBulkSendWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1233,7 +1236,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - public async System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestBulkSendWithTemplateRequest' is set if (signatureRequestBulkSendWithTemplateRequest == null) @@ -1273,6 +1276,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestBulkSendWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1354,6 +1358,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCancel"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1392,7 +1397,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await SignatureRequestCancelWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -1405,7 +1410,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -1418,7 +1423,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1438,6 +1442,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCancel"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1528,6 +1533,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCreateEmbedded"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1566,7 +1572,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestCreateEmbeddedWithHttpInfoAsync(signatureRequestCreateEmbeddedRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1580,7 +1586,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestCreateEmbeddedRequest' is set if (signatureRequestCreateEmbeddedRequest == null) @@ -1620,6 +1626,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCreateEmbedded"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1710,6 +1717,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1748,7 +1756,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(signatureRequestCreateEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1762,7 +1770,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestCreateEmbeddedWithTemplateRequest' is set if (signatureRequestCreateEmbeddedWithTemplateRequest == null) @@ -1802,6 +1810,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1892,6 +1901,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "file_type", fileType)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFiles"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1931,7 +1941,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - public async System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestFilesWithHttpInfoAsync(signatureRequestId, fileType, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1946,7 +1956,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - public async System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -1959,7 +1969,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1985,6 +1994,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "file_type", fileType)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFiles"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2067,6 +2077,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFilesAsDataUri"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2105,7 +2116,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - public async System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestFilesAsDataUriWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2119,7 +2130,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - public async System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2132,7 +2143,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2152,6 +2162,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFilesAsDataUri"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2240,6 +2251,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "force_download", forceDownload)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFilesAsFileUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2279,7 +2291,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - public async System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestFilesAsFileUrlWithHttpInfoAsync(signatureRequestId, forceDownload, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2294,7 +2306,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - public async System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2307,7 +2319,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2331,6 +2342,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "force_download", forceDownload)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestFilesAsFileUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2413,6 +2425,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2451,7 +2464,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestGetWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2465,7 +2478,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2478,7 +2491,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2498,6 +2510,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2595,6 +2608,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2636,7 +2650,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestListResponse - public async System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestListWithHttpInfoAsync(accountId, page, pageSize, query, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2653,14 +2667,13 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestListResponse) - public async System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2695,6 +2708,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2777,6 +2791,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestReleaseHold"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2815,7 +2830,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestReleaseHoldWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2829,7 +2844,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2842,7 +2857,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2862,6 +2876,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestReleaseHold"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2961,6 +2976,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestRemind"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3000,7 +3016,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestRemindWithHttpInfoAsync(signatureRequestId, signatureRequestRemindRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3015,7 +3031,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3062,6 +3078,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestRemind"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3143,6 +3160,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestRemove"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3175,7 +3193,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await SignatureRequestRemoveWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -3188,7 +3206,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3201,7 +3219,6 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -3221,6 +3238,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestRemove"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3305,6 +3323,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestSend"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3343,7 +3362,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestSendWithHttpInfoAsync(signatureRequestSendRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3357,7 +3376,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestSendRequest' is set if (signatureRequestSendRequest == null) @@ -3397,6 +3416,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestSend"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3487,6 +3507,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestSendWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3525,7 +3546,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestSendWithTemplateWithHttpInfoAsync(signatureRequestSendWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3539,7 +3560,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestSendWithTemplateRequest' is set if (signatureRequestSendWithTemplateRequest == null) @@ -3579,6 +3600,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestSendWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3678,6 +3700,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestUpdate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -3717,7 +3740,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestUpdateWithHttpInfoAsync(signatureRequestId, signatureRequestUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3732,7 +3755,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3779,6 +3802,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "SignatureRequestApi.SignatureRequestUpdate"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/src/Dropbox.Sign/Api/TeamApi.cs b/src/Dropbox.Sign/Api/TeamApi.cs index 13b22c0..8fd6f3b 100644 --- a/src/Dropbox.Sign/Api/TeamApi.cs +++ b/src/Dropbox.Sign/Api/TeamApi.cs @@ -284,7 +284,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Add User to Team @@ -298,7 +298,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Team /// @@ -310,7 +310,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Team @@ -323,7 +323,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete Team /// @@ -334,7 +334,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete Team @@ -346,7 +346,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Team /// @@ -357,7 +357,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Team @@ -369,7 +369,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Team Info /// @@ -381,7 +381,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetInfoResponse - System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Team Info @@ -394,7 +394,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetInfoResponse) - System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Team Invites /// @@ -406,7 +406,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamInvitesResponse - System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Team Invites @@ -419,7 +419,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamInvitesResponse) - System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Team Members /// @@ -433,7 +433,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamMembersResponse - System.Threading.Tasks.Task TeamMembersAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamMembersAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Team Members @@ -448,7 +448,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamMembersResponse) - System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove User from Team /// @@ -460,7 +460,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove User from Team @@ -473,7 +473,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Sub Teams /// @@ -487,7 +487,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamSubTeamsResponse - System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Sub Teams @@ -502,7 +502,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamSubTeamsResponse) - System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Team /// @@ -514,7 +514,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Team @@ -527,7 +527,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -713,6 +713,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "team_id", teamId)); } + localVarRequestOptions.Operation = "TeamApi.TeamAddMember"; localVarRequestOptions.OperationIndex = operationIndex; @@ -752,7 +753,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamAddMemberWithHttpInfoAsync(teamAddMemberRequest, teamId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -767,7 +768,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamAddMemberRequest' is set if (teamAddMemberRequest == null) @@ -811,6 +812,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "team_id", teamId)); } + localVarRequestOptions.Operation = "TeamApi.TeamAddMember"; localVarRequestOptions.OperationIndex = operationIndex; @@ -901,6 +903,7 @@ public Dropbox.Sign.Client.ApiResponse TeamCreateWithHttpInfo(T localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -939,7 +942,7 @@ public Dropbox.Sign.Client.ApiResponse TeamCreateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamCreateWithHttpInfoAsync(teamCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -953,7 +956,7 @@ public Dropbox.Sign.Client.ApiResponse TeamCreateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamCreateRequest' is set if (teamCreateRequest == null) @@ -993,6 +996,7 @@ public Dropbox.Sign.Client.ApiResponse TeamCreateWithHttpInfo(T localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1065,6 +1069,7 @@ public Dropbox.Sign.Client.ApiResponse TeamDeleteWithHttpInfo(int operat localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1102,7 +1107,7 @@ public Dropbox.Sign.Client.ApiResponse TeamDeleteWithHttpInfo(int operat /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await TeamDeleteWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); } @@ -1114,14 +1119,13 @@ public Dropbox.Sign.Client.ApiResponse TeamDeleteWithHttpInfo(int operat /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1140,6 +1144,7 @@ public Dropbox.Sign.Client.ApiResponse TeamDeleteWithHttpInfo(int operat localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1213,6 +1218,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1250,7 +1256,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1263,14 +1269,13 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1289,6 +1294,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1368,6 +1374,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "team_id", teamId)); } + localVarRequestOptions.Operation = "TeamApi.TeamInfo"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1406,7 +1413,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetInfoResponse - public async System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamInfoWithHttpInfoAsync(teamId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1420,14 +1427,13 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetInfoResponse) - public async System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1450,6 +1456,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "team_id", teamId)); } + localVarRequestOptions.Operation = "TeamApi.TeamInfo"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1529,6 +1536,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "email_address", emailAddress)); } + localVarRequestOptions.Operation = "TeamApi.TeamInvites"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1567,7 +1575,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamInvitesResponse - public async System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamInvitesWithHttpInfoAsync(emailAddress, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1581,14 +1589,13 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamInvitesResponse) - public async System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1611,6 +1618,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "email_address", emailAddress)); } + localVarRequestOptions.Operation = "TeamApi.TeamInvites"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1705,6 +1713,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "TeamApi.TeamMembers"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1745,7 +1754,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamMembersResponse - public async System.Threading.Tasks.Task TeamMembersAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamMembersAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamMembersWithHttpInfoAsync(teamId, page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1761,7 +1770,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamMembersResponse) - public async System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamId' is set if (teamId == null) @@ -1774,7 +1783,6 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1802,6 +1810,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "TeamApi.TeamMembers"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1892,6 +1901,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamRemoveMember"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1930,7 +1940,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamRemoveMemberWithHttpInfoAsync(teamRemoveMemberRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1944,7 +1954,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamRemoveMemberRequest' is set if (teamRemoveMemberRequest == null) @@ -1984,6 +1994,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamRemoveMember"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2078,6 +2089,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "TeamApi.TeamSubTeams"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2118,7 +2130,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamSubTeamsResponse - public async System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamSubTeamsWithHttpInfoAsync(teamId, page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2134,7 +2146,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamSubTeamsResponse) - public async System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamId' is set if (teamId == null) @@ -2147,7 +2159,6 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2175,6 +2186,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "page_size", pageSize)); } + localVarRequestOptions.Operation = "TeamApi.TeamSubTeams"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2265,6 +2277,7 @@ public Dropbox.Sign.Client.ApiResponse TeamUpdateWithHttpInfo(T localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamUpdate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2303,7 +2316,7 @@ public Dropbox.Sign.Client.ApiResponse TeamUpdateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamUpdateWithHttpInfoAsync(teamUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2317,7 +2330,7 @@ public Dropbox.Sign.Client.ApiResponse TeamUpdateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'teamUpdateRequest' is set if (teamUpdateRequest == null) @@ -2357,6 +2370,7 @@ public Dropbox.Sign.Client.ApiResponse TeamUpdateWithHttpInfo(T localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TeamApi.TeamUpdate"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/src/Dropbox.Sign/Api/TemplateApi.cs b/src/Dropbox.Sign/Api/TemplateApi.cs index 103e311..01bb322 100644 --- a/src/Dropbox.Sign/Api/TemplateApi.cs +++ b/src/Dropbox.Sign/Api/TemplateApi.cs @@ -317,7 +317,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Add User to Template @@ -331,7 +331,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Template /// @@ -343,7 +343,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateResponse - System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Template @@ -356,7 +356,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateResponse) - System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Template Draft /// @@ -368,7 +368,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateEmbeddedDraftResponse - System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Template Draft @@ -381,7 +381,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateEmbeddedDraftResponse) - System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete Template /// @@ -393,7 +393,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Delete Template @@ -406,7 +406,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files /// @@ -419,7 +419,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files @@ -433,7 +433,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files as Data Uri /// @@ -445,7 +445,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files as Data Uri @@ -458,7 +458,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files as File Url /// @@ -471,7 +471,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template Files as File Url @@ -485,7 +485,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template /// @@ -497,7 +497,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Get Template @@ -510,7 +510,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Templates /// @@ -525,7 +525,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateListResponse - System.Threading.Tasks.Task TemplateListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// List Templates @@ -541,7 +541,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateListResponse) - System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove User from Template /// @@ -554,7 +554,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Remove User from Template @@ -568,7 +568,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Template Files /// @@ -581,7 +581,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateUpdateFilesResponse - System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Update Template Files @@ -595,7 +595,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateUpdateFilesResponse) - System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -784,6 +784,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateAddUserWithH } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateAddUser"; localVarRequestOptions.OperationIndex = operationIndex; @@ -823,7 +824,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateAddUserWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - public async System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateAddUserWithHttpInfoAsync(templateId, templateAddUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -838,7 +839,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateAddUserWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - public async System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -885,6 +886,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateAddUserWithH } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateAddUser"; localVarRequestOptions.OperationIndex = operationIndex; @@ -975,6 +977,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateCreateWit localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TemplateApi.TemplateCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1013,7 +1016,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateCreateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateResponse - public async System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateCreateWithHttpInfoAsync(templateCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1027,7 +1030,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateCreateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateResponse) - public async System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateCreateRequest' is set if (templateCreateRequest == null) @@ -1067,6 +1070,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateCreateWit localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TemplateApi.TemplateCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1157,6 +1161,7 @@ public Dropbox.Sign.Client.ApiResponse Temp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TemplateApi.TemplateCreateEmbeddedDraft"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1195,7 +1200,7 @@ public Dropbox.Sign.Client.ApiResponse Temp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateEmbeddedDraftResponse - public async System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateCreateEmbeddedDraftWithHttpInfoAsync(templateCreateEmbeddedDraftRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1209,7 +1214,7 @@ public Dropbox.Sign.Client.ApiResponse Temp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateEmbeddedDraftResponse) - public async System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateCreateEmbeddedDraftRequest' is set if (templateCreateEmbeddedDraftRequest == null) @@ -1249,6 +1254,7 @@ public Dropbox.Sign.Client.ApiResponse Temp localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "TemplateApi.TemplateCreateEmbeddedDraft"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1330,6 +1336,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1368,7 +1375,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { await TemplateDeleteWithHttpInfoAsync(templateId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -1381,7 +1388,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1394,7 +1401,6 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1414,6 +1420,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateDelete"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1504,6 +1511,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "file_type", fileType)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateFiles"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1543,7 +1551,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - public async System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateFilesWithHttpInfoAsync(templateId, fileType, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1558,7 +1566,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - public async System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1571,7 +1579,6 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1597,6 +1604,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "file_type", fileType)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateFiles"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1679,6 +1687,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateFilesAsDataUri"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1717,7 +1726,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - public async System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateFilesAsDataUriWithHttpInfoAsync(templateId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1731,7 +1740,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - public async System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1744,7 +1753,6 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1764,6 +1772,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateFilesAsDataUri"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1852,6 +1861,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "force_download", forceDownload)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateFilesAsFileUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1891,7 +1901,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - public async System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateFilesAsFileUrlWithHttpInfoAsync(templateId, forceDownload, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1906,7 +1916,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - public async System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1919,7 +1929,6 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -1943,6 +1952,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "force_download", forceDownload)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateFilesAsFileUrl"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2025,6 +2035,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2063,7 +2074,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - public async System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateGetWithHttpInfoAsync(templateId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2077,7 +2088,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - public async System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -2090,7 +2101,6 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2110,6 +2120,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateGet"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2207,6 +2218,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2248,7 +2260,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateListResponse - public async System.Threading.Tasks.Task TemplateListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateListWithHttpInfoAsync(accountId, page, pageSize, query, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2265,14 +2277,13 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateListResponse) - public async System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); string[] _contentTypes = new string[] { }; - var localVarContentType = Dropbox.Sign.Client.ClientUtils.SelectHeaderContentType(_contentTypes); // to determine the Accept header @@ -2307,6 +2318,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI { localVarRequestOptions.QueryParameters.Add(Dropbox.Sign.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } + localVarRequestOptions.Operation = "TemplateApi.TemplateList"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2406,6 +2418,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateRemoveUserWi } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateRemoveUser"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2445,7 +2458,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateRemoveUserWi /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - public async System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateRemoveUserWithHttpInfoAsync(templateId, templateRemoveUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2460,7 +2473,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateRemoveUserWi /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - public async System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -2507,6 +2520,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateRemoveUserWi } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateRemoveUser"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2606,6 +2620,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateUpda } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateUpdateFiles"; localVarRequestOptions.OperationIndex = operationIndex; @@ -2645,7 +2660,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateUpda /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateUpdateFilesResponse - public async System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateUpdateFilesWithHttpInfoAsync(templateId, templateUpdateFilesRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2660,7 +2675,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateUpda /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateUpdateFilesResponse) - public async System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -2707,6 +2722,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateUpda } localVarRequestOptions.PathParameters.Add("template_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(templateId)); // path parameter + localVarRequestOptions.Operation = "TemplateApi.TemplateUpdateFiles"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs b/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs index c429103..6e23e47 100644 --- a/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs +++ b/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs @@ -141,7 +141,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Unclaimed Draft @@ -154,7 +154,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Unclaimed Draft /// @@ -166,7 +166,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Unclaimed Draft @@ -179,7 +179,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Unclaimed Draft with Template /// @@ -191,7 +191,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Create Embedded Unclaimed Draft with Template @@ -204,7 +204,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Edit and Resend Unclaimed Draft /// @@ -217,7 +217,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Edit and Resend Unclaimed Draft @@ -231,7 +231,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -411,6 +411,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -449,7 +450,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftCreateWithHttpInfoAsync(unclaimedDraftCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -463,7 +464,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'unclaimedDraftCreateRequest' is set if (unclaimedDraftCreateRequest == null) @@ -503,6 +504,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -593,6 +595,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreateEmbedded"; localVarRequestOptions.OperationIndex = operationIndex; @@ -631,7 +634,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(unclaimedDraftCreateEmbeddedRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -645,7 +648,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'unclaimedDraftCreateEmbeddedRequest' is set if (unclaimedDraftCreateEmbeddedRequest == null) @@ -685,6 +688,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreateEmbedded"; localVarRequestOptions.OperationIndex = operationIndex; @@ -775,6 +779,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -813,7 +818,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(unclaimedDraftCreateEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -827,7 +832,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'unclaimedDraftCreateEmbeddedWithTemplateRequest' is set if (unclaimedDraftCreateEmbeddedWithTemplateRequest == null) @@ -867,6 +872,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftCreateEmbeddedWithTemplate"; localVarRequestOptions.OperationIndex = operationIndex; @@ -966,6 +972,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftEditAndResend"; localVarRequestOptions.OperationIndex = operationIndex; @@ -1005,7 +1012,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftEditAndResendWithHttpInfoAsync(signatureRequestId, unclaimedDraftEditAndResendRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1020,7 +1027,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -1067,6 +1074,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr } localVarRequestOptions.PathParameters.Add("signature_request_id", Dropbox.Sign.Client.ClientUtils.ParameterToString(signatureRequestId)); // path parameter + localVarRequestOptions.Operation = "UnclaimedDraftApi.UnclaimedDraftEditAndResend"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/src/Dropbox.Sign/Client/ApiClient.cs b/src/Dropbox.Sign/Client/ApiClient.cs index c64b27d..2e1fe92 100644 --- a/src/Dropbox.Sign/Client/ApiClient.cs +++ b/src/Dropbox.Sign/Client/ApiClient.cs @@ -23,13 +23,14 @@ using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -using System.Web; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; using Polly; +using Dropbox.Sign.Model; namespace Dropbox.Sign.Client { @@ -39,7 +40,6 @@ namespace Dropbox.Sign.Client internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer { private readonly IReadableConfiguration _configuration; - private static readonly string _contentType = "application/json"; private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. @@ -71,10 +71,10 @@ public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfi /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is Dropbox.Sign.Model.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return ((Dropbox.Sign.Model.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -119,7 +119,7 @@ internal object Deserialize(RestResponse response, Type type) if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -130,7 +130,7 @@ internal object Deserialize(RestResponse response, Type type) if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -152,17 +152,13 @@ internal object Deserialize(RestResponse response, Type type) public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.Serializers.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => - contentType.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || - contentType.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public string ContentType - { - get { return _contentType; } - set { throw new InvalidOperationException("Not allowed to set content type."); } - } + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -176,8 +172,7 @@ public partial class ApiClient : ISynchronousClient, IAsynchronousClient private readonly RestClient _restClient; - - /// + /// /// Specifies the settings on a object. /// These settings can be adjusted to accommodate custom serialization rules. /// @@ -212,7 +207,7 @@ public partial class ApiClient : ISynchronousClient, IAsynchronousClient /// public ApiClient() { - _baseUrl = Dropbox.Sign.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -284,14 +279,14 @@ private RestSharpMethod Method(HttpMethod method) /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -399,7 +394,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -409,6 +404,13 @@ private RestRequest NewRequest( return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -453,199 +455,178 @@ private ApiResponse ToApiResponse(RestResponse response) return transformed; } - private ApiResponse Exec(RestRequest req, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent + UserAgent = configuration.UserAgent, + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - + setOptions(clientOptions); + RestClient client = _restClient; if (client == null) { - client = new RestClient(clientOptions); + client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)) + ); } - client.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)); + using (client) + { + InterceptRequest(request); - InterceptRequest(req); + RestResponse response = await getResponse(client); - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) - { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { - Request = req, - ErrorException = policyResult.FinalException - }; - } - else - { - response = client.Execute(req); - } - - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Dropbox.Sign.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - try + try + { + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } + } + else if (typeof(T).Name == "Stream") // for binary response { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + response.Data = (T)(object)new MemoryStream(response.RawBytes); } - catch (Exception ex) + else if (typeof(T).Name == "Byte[]") // for byte response { - throw ex.InnerException != null ? ex.InnerException : ex; + response.Data = (T)(object)response.RawBytes; + } + else if (typeof(T).Name == "String") // for string response + { + response.Data = (T)(object)response.Content; } - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - else if (typeof(T).Name == "String") // for string response - { - response.Data = (T)(object)response.Content; - } - InterceptResponse(req, response); + InterceptResponse(request, response); - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (response.Cookies != null && response.Cookies.Count > 0) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies.Cast()) { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } } + return result; } - return result; } - private async Task> ExecAsync(RestRequest req, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) + if (policyResult.Outcome == OutcomeType.Successful) { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent - }; - - RestClient client = new RestClient(clientOptions) - .UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)); - - InterceptRequest(req); - - RestResponse response; - if (RetryConfiguration.AsyncRetryPolicy != null) + return client.Deserialize(policyResult.Result); + } + else { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(req, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + return new RestResponse(request) { - Request = req, ErrorException = policyResult.FinalException }; } - else + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => { - response = await client.ExecuteAsync(req, cancellationToken).ConfigureAwait(false); - } + var cookies = new CookieContainer(); - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof(Dropbox.Sign.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; + }; + + Func>> getResponse = (client) => { - response.Data = (T)(object)response.RawBytes; - } + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return Task.FromResult(DeserializeRestResponseFromPolicy(client, request, policyResult)); + } + else + { + return Task.FromResult(client.Execute(request)); + } + }; - InterceptResponse(req, response); + return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); + } - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => { - result.ErrorText = response.ErrorMessage; - } + //no extra options + }; - if (response.Cookies != null && response.Cookies.Count > 0) + Func>> getResponse = async (client) => { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; + else + { + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + } + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration); } #region IAsynchronousClient @@ -658,7 +639,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -673,7 +654,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -688,7 +669,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -703,7 +684,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -718,7 +699,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -733,7 +714,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -748,7 +729,7 @@ private ApiResponse Exec(RestRequest req, RequestOptions options, IReadabl /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/src/Dropbox.Sign/Client/ClientUtils.cs b/src/Dropbox.Sign/Client/ClientUtils.cs index 2916c1d..645421e 100644 --- a/src/Dropbox.Sign/Client/ClientUtils.cs +++ b/src/Dropbox.Sign/Client/ClientUtils.cs @@ -15,9 +15,9 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Runtime.Serialization; using Newtonsoft.Json; using Dropbox.Sign.Model; @@ -105,8 +105,12 @@ public static string ParameterToString(object obj, IReadableConfiguration config return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); @@ -130,7 +134,7 @@ public static string Serialize(object obj) /// Encoded string. public static string Base64Encode(string text) { - return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); } /// @@ -293,7 +297,7 @@ public static void SetFormData(RequestOptions requestOptions, List item.Value.ToString() ); - continue; + continue; } if (item.Value is Enum) diff --git a/src/Dropbox.Sign/Client/Configuration.cs b/src/Dropbox.Sign/Client/Configuration.cs index 88b528f..dfcc2be 100644 --- a/src/Dropbox.Sign/Client/Configuration.cs +++ b/src/Dropbox.Sign/Client/Configuration.cs @@ -18,11 +18,11 @@ using System.Reflection; using System.Security.Cryptography.X509Certificates; using System.Text; -using Newtonsoft.Json; using System.Net.Http; +using System.Net.Security; +using Newtonsoft.Json; using Dropbox.Sign.Model; - namespace Dropbox.Sign.Client { /// @@ -36,7 +36,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "1.5.0"; + public const string Version = "1.6.0"; /// /// Identifier for ISO 8601 DateTime Format @@ -79,6 +79,8 @@ public class Configuration : IReadableConfiguration /// private string _basePath; + private bool _useDefaultCredentials = false; + /// /// Gets or sets the API key based on the authentication name. /// This is the key and value comprising the "secret" for accessing an API. @@ -114,11 +116,11 @@ public class Configuration : IReadableConfiguration /// /// Initializes a new instance of the class /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration() { Proxy = null; - UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.5.0/csharp"); + UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.6.0/csharp"); BasePath = "https://api.hellosign.com/v3"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); @@ -167,7 +169,7 @@ public Configuration() /// /// Initializes a new instance of the class /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration( IDictionary defaultHeaders, IDictionary apiKey, @@ -208,11 +210,21 @@ public Configuration( /// /// Gets or sets the base path for API access. /// - public virtual string BasePath { + public virtual string BasePath + { get { return _basePath; } set { _basePath = value; } } + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + /// /// Gets or sets the default header. /// @@ -477,7 +489,7 @@ public string GetOperationServerUrl(string operation, int index) /// The operation server URL. public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) { - if (OperationServers.TryGetValue(operation, out var operationServer)) + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) { return GetServerUrl(operationServer, index, inputVariables); } @@ -536,6 +548,11 @@ private string GetServerUrl(IList> servers, return url; } + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } #endregion Properties @@ -550,7 +567,7 @@ public static string ToDebugReport() report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; report += " Version of the API: 3.0.0\n"; - report += " SDK Package Version: 1.5.0\n"; + report += " SDK Package Version: 1.6.0\n"; return report; } @@ -612,6 +629,8 @@ public static IReadableConfiguration MergeConfigurations(IReadableConfiguration TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, }; return config; } diff --git a/src/Dropbox.Sign/Client/IAsynchronousClient.cs b/src/Dropbox.Sign/Client/IAsynchronousClient.cs index 6d1c11d..66e347c 100644 --- a/src/Dropbox.Sign/Client/IAsynchronousClient.cs +++ b/src/Dropbox.Sign/Client/IAsynchronousClient.cs @@ -30,7 +30,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -41,7 +41,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -52,7 +52,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -63,7 +63,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -74,7 +74,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -85,7 +85,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -96,6 +96,6 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); } } diff --git a/src/Dropbox.Sign/Client/IReadableConfiguration.cs b/src/Dropbox.Sign/Client/IReadableConfiguration.cs index 0953591..a4e493e 100644 --- a/src/Dropbox.Sign/Client/IReadableConfiguration.cs +++ b/src/Dropbox.Sign/Client/IReadableConfiguration.cs @@ -12,6 +12,7 @@ using System; using System.Collections.Generic; using System.Net; +using System.Net.Security; using System.Security.Cryptography.X509Certificates; namespace Dropbox.Sign.Client @@ -100,6 +101,11 @@ public interface IReadableConfiguration /// Password. string Password { get; } + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + /// /// Get the servers associated with the operation. /// @@ -126,5 +132,11 @@ public interface IReadableConfiguration /// /// X509 Certificate collection. X509CertificateCollection ClientCertificates { get; } + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } } } diff --git a/src/Dropbox.Sign/Client/RequestOptions.cs b/src/Dropbox.Sign/Client/RequestOptions.cs index f1839c9..54db7aa 100644 --- a/src/Dropbox.Sign/Client/RequestOptions.cs +++ b/src/Dropbox.Sign/Client/RequestOptions.cs @@ -34,7 +34,7 @@ public class RequestOptions public Multimap QueryParameters { get; set; } /// - /// Header parameters to be applied to to the request. + /// Header parameters to be applied to the request. /// Keys may have 1 or more values associated. /// public Multimap HeaderParameters { get; set; } diff --git a/src/Dropbox.Sign/Dropbox.Sign.csproj b/src/Dropbox.Sign/Dropbox.Sign.csproj index 82704d3..8739b42 100644 --- a/src/Dropbox.Sign/Dropbox.Sign.csproj +++ b/src/Dropbox.Sign/Dropbox.Sign.csproj @@ -10,21 +10,26 @@ Dropbox Sign API Team Dropbox Sign .Net SDK Client library for using the Dropbox Sign API + Dropbox 2024 Dropbox.Sign - 1.5.0 + 1.6.0 bin\$(Configuration)\$(TargetFramework)\Dropbox.Sign.xml https://github.com/hellosign/dropbox-sign-dotnet.git git Minor update annotations + false - - - - - + + + + + + + + diff --git a/src/Dropbox.Sign/Model/AbstractOpenAPISchema.cs b/src/Dropbox.Sign/Model/AbstractOpenAPISchema.cs index f0eb45d..76b5174 100644 --- a/src/Dropbox.Sign/Model/AbstractOpenAPISchema.cs +++ b/src/Dropbox.Sign/Model/AbstractOpenAPISchema.cs @@ -10,9 +10,9 @@ using System; -using System.Collections.Generic; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using System.Collections.Generic; namespace Dropbox.Sign.Model { diff --git a/src/Dropbox.Sign/Model/AccountCreateRequest.cs b/src/Dropbox.Sign/Model/AccountCreateRequest.cs index f244861..c8569fb 100644 --- a/src/Dropbox.Sign/Model/AccountCreateRequest.cs +++ b/src/Dropbox.Sign/Model/AccountCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountCreateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -81,28 +81,28 @@ public static AccountCreateRequest Init(string jsonData) /// The email address which will be associated with the new Account. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) /// /// Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) /// /// Used when creating a new account with OAuth authorization. See [OAuth 2.0 Authorization](https://app.hellosign.com/api/oauthWalkthrough#OAuthAuthorization) [DataMember(Name = "client_secret", EmitDefaultValue = true)] public string ClientSecret { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "locale", EmitDefaultValue = true)] public string Locale { get; set; } - + /// /// Returns the string presentation of the object /// @@ -201,6 +201,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -231,16 +240,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/AccountCreateResponse.cs b/src/Dropbox.Sign/Model/AccountCreateResponse.cs index 0da9d72..498d367 100644 --- a/src/Dropbox.Sign/Model/AccountCreateResponse.cs +++ b/src/Dropbox.Sign/Model/AccountCreateResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountCreateResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountCreateResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountCreateResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,12 +41,17 @@ protected AccountCreateResponse() { } /// /// Initializes a new instance of the class. /// - /// account. + /// account (required). /// oauthData. /// A list of warnings.. public AccountCreateResponse(AccountResponse account = default(AccountResponse), OAuthTokenResponse oauthData = default(OAuthTokenResponse), List warnings = default(List)) { + // to ensure "account" is required (not null) + if (account == null) + { + throw new ArgumentNullException("account is a required property for AccountCreateResponse and cannot be null"); + } this.Account = account; this.OauthData = oauthData; this.Warnings = warnings; @@ -71,22 +76,22 @@ public static AccountCreateResponse Init(string jsonData) /// /// Gets or Sets Account /// - [DataMember(Name = "account", EmitDefaultValue = true)] + [DataMember(Name = "account", IsRequired = true, EmitDefaultValue = true)] public AccountResponse Account { get; set; } - + /// /// Gets or Sets OauthData /// [DataMember(Name = "oauth_data", EmitDefaultValue = true)] public OAuthTokenResponse OauthData { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -176,6 +181,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -200,16 +214,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/AccountGetResponse.cs b/src/Dropbox.Sign/Model/AccountGetResponse.cs index b98e617..4e5c2f1 100644 --- a/src/Dropbox.Sign/Model/AccountGetResponse.cs +++ b/src/Dropbox.Sign/Model/AccountGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected AccountGetResponse() { } /// /// Initializes a new instance of the class. /// - /// account. + /// account (required). /// A list of warnings.. public AccountGetResponse(AccountResponse account = default(AccountResponse), List warnings = default(List)) { + // to ensure "account" is required (not null) + if (account == null) + { + throw new ArgumentNullException("account is a required property for AccountGetResponse and cannot be null"); + } this.Account = account; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static AccountGetResponse Init(string jsonData) /// /// Gets or Sets Account /// - [DataMember(Name = "account", EmitDefaultValue = true)] + [DataMember(Name = "account", IsRequired = true, EmitDefaultValue = true)] public AccountResponse Account { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/AccountResponse.cs b/src/Dropbox.Sign/Model/AccountResponse.cs index e5b102f..39bd9bf 100644 --- a/src/Dropbox.Sign/Model/AccountResponse.cs +++ b/src/Dropbox.Sign/Model/AccountResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -90,75 +90,75 @@ public static AccountResponse Init(string jsonData) /// The ID of the Account [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The email address associated with the Account. /// /// The email address associated with the Account. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns `true` if the user has been locked out of their account by a team admin. /// /// Returns `true` if the user has been locked out of their account by a team admin. [DataMember(Name = "is_locked", EmitDefaultValue = true)] public bool IsLocked { get; set; } - + /// /// Returns `true` if the user has a paid Dropbox Sign account. /// /// Returns `true` if the user has a paid Dropbox Sign account. [DataMember(Name = "is_paid_hs", EmitDefaultValue = true)] public bool IsPaidHs { get; set; } - + /// /// Returns `true` if the user has a paid HelloFax account. /// /// Returns `true` if the user has a paid HelloFax account. [DataMember(Name = "is_paid_hf", EmitDefaultValue = true)] public bool IsPaidHf { get; set; } - + /// /// Gets or Sets Quotas /// [DataMember(Name = "quotas", EmitDefaultValue = true)] public AccountResponseQuotas Quotas { get; set; } - + /// /// The URL that Dropbox Sign events will `POST` to. /// /// The URL that Dropbox Sign events will `POST` to. [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// The membership role for the team. /// /// The membership role for the team. [DataMember(Name = "role_code", EmitDefaultValue = true)] public string RoleCode { get; set; } - + /// /// The id of the team account belongs to. /// /// The id of the team account belongs to. [DataMember(Name = "team_id", EmitDefaultValue = true)] public string TeamId { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "locale", EmitDefaultValue = true)] public string Locale { get; set; } - + /// /// Gets or Sets Usage /// [DataMember(Name = "usage", EmitDefaultValue = true)] public AccountResponseUsage Usage { get; set; } - + /// /// Returns the string presentation of the object /// @@ -315,6 +315,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -387,16 +396,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/AccountResponseQuotas.cs b/src/Dropbox.Sign/Model/AccountResponseQuotas.cs index bf46598..28a16d5 100644 --- a/src/Dropbox.Sign/Model/AccountResponseQuotas.cs +++ b/src/Dropbox.Sign/Model/AccountResponseQuotas.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountResponseQuotas")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountResponseQuotas : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountResponseQuotas : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,42 +80,42 @@ public static AccountResponseQuotas Init(string jsonData) /// API signature requests remaining. [DataMember(Name = "api_signature_requests_left", EmitDefaultValue = true)] public int? ApiSignatureRequestsLeft { get; set; } - + /// /// Signature requests remaining. /// /// Signature requests remaining. [DataMember(Name = "documents_left", EmitDefaultValue = true)] public int? DocumentsLeft { get; set; } - + /// /// Total API templates allowed. /// /// Total API templates allowed. [DataMember(Name = "templates_total", EmitDefaultValue = true)] public int? TemplatesTotal { get; set; } - + /// /// API templates remaining. /// /// API templates remaining. [DataMember(Name = "templates_left", EmitDefaultValue = true)] public int? TemplatesLeft { get; set; } - + /// /// SMS verifications remaining. /// /// SMS verifications remaining. [DataMember(Name = "sms_verifications_left", EmitDefaultValue = true)] public int? SmsVerificationsLeft { get; set; } - + /// /// Number of fax pages left /// /// Number of fax pages left [DataMember(Name = "num_fax_pages_left", EmitDefaultValue = true)] public int? NumFaxPagesLeft { get; set; } - + /// /// Returns the string presentation of the object /// @@ -234,6 +234,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -276,16 +285,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/AccountResponseUsage.cs b/src/Dropbox.Sign/Model/AccountResponseUsage.cs index 2a72141..068f2a7 100644 --- a/src/Dropbox.Sign/Model/AccountResponseUsage.cs +++ b/src/Dropbox.Sign/Model/AccountResponseUsage.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountResponseUsage")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountResponseUsage : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountResponseUsage : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static AccountResponseUsage Init(string jsonData) /// Number of fax pages sent [DataMember(Name = "fax_pages_sent", EmitDefaultValue = true)] public int? FaxPagesSent { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +139,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -151,16 +160,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/AccountUpdateRequest.cs b/src/Dropbox.Sign/Model/AccountUpdateRequest.cs index 2048e32..e0ce0ef 100644 --- a/src/Dropbox.Sign/Model/AccountUpdateRequest.cs +++ b/src/Dropbox.Sign/Model/AccountUpdateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountUpdateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountUpdateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountUpdateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -74,21 +74,21 @@ public static AccountUpdateRequest Init(string jsonData) /// The ID of the Account [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The URL that Dropbox Sign should POST events to. /// /// The URL that Dropbox Sign should POST events to. [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "locale", EmitDefaultValue = true)] public string Locale { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,6 +177,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -201,16 +210,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/AccountVerifyRequest.cs b/src/Dropbox.Sign/Model/AccountVerifyRequest.cs index 13de318..b13781a 100644 --- a/src/Dropbox.Sign/Model/AccountVerifyRequest.cs +++ b/src/Dropbox.Sign/Model/AccountVerifyRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountVerifyRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountVerifyRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountVerifyRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -75,7 +75,7 @@ public static AccountVerifyRequest Init(string jsonData) /// Email address to run the verification for. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -144,6 +144,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -156,16 +165,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/AccountVerifyResponse.cs b/src/Dropbox.Sign/Model/AccountVerifyResponse.cs index f4c9751..f8b0b8e 100644 --- a/src/Dropbox.Sign/Model/AccountVerifyResponse.cs +++ b/src/Dropbox.Sign/Model/AccountVerifyResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountVerifyResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountVerifyResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountVerifyResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -71,14 +71,14 @@ public static AccountVerifyResponse Init(string jsonData) /// [DataMember(Name = "account", EmitDefaultValue = true)] public AccountVerifyResponseAccount Account { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/AccountVerifyResponseAccount.cs b/src/Dropbox.Sign/Model/AccountVerifyResponseAccount.cs index 39edf9b..8d56b23 100644 --- a/src/Dropbox.Sign/Model/AccountVerifyResponseAccount.cs +++ b/src/Dropbox.Sign/Model/AccountVerifyResponseAccount.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "AccountVerifyResponseAccount")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class AccountVerifyResponseAccount : IOpenApiTyped, IEquatable, IValidatableObject + public partial class AccountVerifyResponseAccount : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static AccountVerifyResponseAccount Init(string jsonData) /// The email address associated with the Account. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +139,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -151,16 +160,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ApiAppCreateRequest.cs b/src/Dropbox.Sign/Model/ApiAppCreateRequest.cs index ca0b798..535fc80 100644 --- a/src/Dropbox.Sign/Model/ApiAppCreateRequest.cs +++ b/src/Dropbox.Sign/Model/ApiAppCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppCreateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -92,46 +92,46 @@ public static ApiAppCreateRequest Init(string jsonData) /// The domain names the ApiApp will be associated with. [DataMember(Name = "domains", IsRequired = true, EmitDefaultValue = true)] public List Domains { get; set; } - + /// /// The name you want to assign to the ApiApp. /// /// The name you want to assign to the ApiApp. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The URL at which the ApiApp should receive event callbacks. /// /// The URL at which the ApiApp should receive event callbacks. [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) /// /// An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) [DataMember(Name = "custom_logo_file", EmitDefaultValue = true)] public System.IO.Stream CustomLogoFile { get; set; } - + /// /// Gets or Sets Oauth /// [DataMember(Name = "oauth", EmitDefaultValue = true)] public SubOAuth Oauth { get; set; } - + /// /// Gets or Sets Options /// [DataMember(Name = "options", EmitDefaultValue = true)] public SubOptions Options { get; set; } - + /// /// Gets or Sets WhiteLabelingOptions /// [DataMember(Name = "white_labeling_options", EmitDefaultValue = true)] public SubWhiteLabelingOptions WhiteLabelingOptions { get; set; } - + /// /// Returns the string presentation of the object /// @@ -261,6 +261,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -309,16 +318,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ApiAppGetResponse.cs b/src/Dropbox.Sign/Model/ApiAppGetResponse.cs index 6fd9e3f..5bc614d 100644 --- a/src/Dropbox.Sign/Model/ApiAppGetResponse.cs +++ b/src/Dropbox.Sign/Model/ApiAppGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected ApiAppGetResponse() { } /// /// Initializes a new instance of the class. /// - /// apiApp. + /// apiApp (required). /// A list of warnings.. public ApiAppGetResponse(ApiAppResponse apiApp = default(ApiAppResponse), List warnings = default(List)) { + // to ensure "apiApp" is required (not null) + if (apiApp == null) + { + throw new ArgumentNullException("apiApp is a required property for ApiAppGetResponse and cannot be null"); + } this.ApiApp = apiApp; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static ApiAppGetResponse Init(string jsonData) /// /// Gets or Sets ApiApp /// - [DataMember(Name = "api_app", EmitDefaultValue = true)] + [DataMember(Name = "api_app", IsRequired = true, EmitDefaultValue = true)] public ApiAppResponse ApiApp { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ApiAppListResponse.cs b/src/Dropbox.Sign/Model/ApiAppListResponse.cs index c43833a..26e2b28 100644 --- a/src/Dropbox.Sign/Model/ApiAppListResponse.cs +++ b/src/Dropbox.Sign/Model/ApiAppListResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppListResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppListResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppListResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected ApiAppListResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains information about API Apps.. - /// listInfo. + /// Contains information about API Apps. (required). + /// listInfo (required). /// A list of warnings.. public ApiAppListResponse(List apiApps = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "apiApps" is required (not null) + if (apiApps == null) + { + throw new ArgumentNullException("apiApps is a required property for ApiAppListResponse and cannot be null"); + } this.ApiApps = apiApps; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for ApiAppListResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,22 +82,22 @@ public static ApiAppListResponse Init(string jsonData) /// Contains information about API Apps. /// /// Contains information about API Apps. - [DataMember(Name = "api_apps", EmitDefaultValue = true)] + [DataMember(Name = "api_apps", IsRequired = true, EmitDefaultValue = true)] public List ApiApps { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -178,6 +188,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -202,16 +221,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ApiAppResponse.cs b/src/Dropbox.Sign/Model/ApiAppResponse.cs index fb4b752..e377917 100644 --- a/src/Dropbox.Sign/Model/ApiAppResponse.cs +++ b/src/Dropbox.Sign/Model/ApiAppResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -88,66 +88,66 @@ public static ApiAppResponse Init(string jsonData) /// The app's callback URL (for events) [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// The app's client id /// /// The app's client id [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// The time that the app was created /// /// The time that the app was created [DataMember(Name = "created_at", EmitDefaultValue = true)] public int CreatedAt { get; set; } - + /// /// The domain name(s) associated with the app /// /// The domain name(s) associated with the app [DataMember(Name = "domains", EmitDefaultValue = true)] public List Domains { get; set; } - + /// /// The name of the app /// /// The name of the app [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Boolean to indicate if the app has been approved /// /// Boolean to indicate if the app has been approved [DataMember(Name = "is_approved", EmitDefaultValue = true)] public bool IsApproved { get; set; } - + /// /// Gets or Sets Oauth /// [DataMember(Name = "oauth", EmitDefaultValue = true)] public ApiAppResponseOAuth Oauth { get; set; } - + /// /// Gets or Sets Options /// [DataMember(Name = "options", EmitDefaultValue = true)] public ApiAppResponseOptions Options { get; set; } - + /// /// Gets or Sets OwnerAccount /// [DataMember(Name = "owner_account", EmitDefaultValue = true)] public ApiAppResponseOwnerAccount OwnerAccount { get; set; } - + /// /// Gets or Sets WhiteLabelingOptions /// [DataMember(Name = "white_labeling_options", EmitDefaultValue = true)] public ApiAppResponseWhiteLabelingOptions WhiteLabelingOptions { get; set; } - + /// /// Returns the string presentation of the object /// @@ -299,6 +299,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -365,16 +374,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ApiAppResponseOAuth.cs b/src/Dropbox.Sign/Model/ApiAppResponseOAuth.cs index 91bbff9..d1b7c49 100644 --- a/src/Dropbox.Sign/Model/ApiAppResponseOAuth.cs +++ b/src/Dropbox.Sign/Model/ApiAppResponseOAuth.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppResponseOAuth")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppResponseOAuth : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppResponseOAuth : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,28 +76,28 @@ public static ApiAppResponseOAuth Init(string jsonData) /// The app's OAuth callback URL. [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// The app's OAuth secret, or null if the app does not belong to user. /// /// The app's OAuth secret, or null if the app does not belong to user. [DataMember(Name = "secret", EmitDefaultValue = true)] public string Secret { get; set; } - + /// /// Array of OAuth scopes used by the app. /// /// Array of OAuth scopes used by the app. [DataMember(Name = "scopes", EmitDefaultValue = true)] public List Scopes { get; set; } - + /// /// Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. /// /// Boolean indicating whether the app owner or the account granting permission is billed for OAuth requests. [DataMember(Name = "charges_users", EmitDefaultValue = true)] public bool ChargesUsers { get; set; } - + /// /// Returns the string presentation of the object /// @@ -193,6 +193,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -223,16 +232,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ApiAppResponseOptions.cs b/src/Dropbox.Sign/Model/ApiAppResponseOptions.cs index 948ef41..55e16f2 100644 --- a/src/Dropbox.Sign/Model/ApiAppResponseOptions.cs +++ b/src/Dropbox.Sign/Model/ApiAppResponseOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppResponseOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppResponseOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppResponseOptions : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static ApiAppResponseOptions Init(string jsonData) /// Boolean denoting if signers can \"Insert Everywhere\" in one click while signing a document [DataMember(Name = "can_insert_everywhere", EmitDefaultValue = true)] public bool CanInsertEverywhere { get; set; } - + /// /// Returns the string presentation of the object /// @@ -135,6 +135,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -147,16 +156,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ApiAppResponseOwnerAccount.cs b/src/Dropbox.Sign/Model/ApiAppResponseOwnerAccount.cs index 0ee2ac6..8a57bae 100644 --- a/src/Dropbox.Sign/Model/ApiAppResponseOwnerAccount.cs +++ b/src/Dropbox.Sign/Model/ApiAppResponseOwnerAccount.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppResponseOwnerAccount")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppResponseOwnerAccount : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppResponseOwnerAccount : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static ApiAppResponseOwnerAccount Init(string jsonData) /// The owner account's ID [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The owner account's email address /// /// The owner account's email address [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ApiAppResponseWhiteLabelingOptions.cs b/src/Dropbox.Sign/Model/ApiAppResponseWhiteLabelingOptions.cs index 5dc24b9..602754b 100644 --- a/src/Dropbox.Sign/Model/ApiAppResponseWhiteLabelingOptions.cs +++ b/src/Dropbox.Sign/Model/ApiAppResponseWhiteLabelingOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppResponseWhiteLabelingOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppResponseWhiteLabelingOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppResponseWhiteLabelingOptions : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -95,85 +95,85 @@ public static ApiAppResponseWhiteLabelingOptions Init(string jsonData) /// [DataMember(Name = "header_background_color", EmitDefaultValue = true)] public string HeaderBackgroundColor { get; set; } - + /// /// Gets or Sets LegalVersion /// [DataMember(Name = "legal_version", EmitDefaultValue = true)] public string LegalVersion { get; set; } - + /// /// Gets or Sets LinkColor /// [DataMember(Name = "link_color", EmitDefaultValue = true)] public string LinkColor { get; set; } - + /// /// Gets or Sets PageBackgroundColor /// [DataMember(Name = "page_background_color", EmitDefaultValue = true)] public string PageBackgroundColor { get; set; } - + /// /// Gets or Sets PrimaryButtonColor /// [DataMember(Name = "primary_button_color", EmitDefaultValue = true)] public string PrimaryButtonColor { get; set; } - + /// /// Gets or Sets PrimaryButtonColorHover /// [DataMember(Name = "primary_button_color_hover", EmitDefaultValue = true)] public string PrimaryButtonColorHover { get; set; } - + /// /// Gets or Sets PrimaryButtonTextColor /// [DataMember(Name = "primary_button_text_color", EmitDefaultValue = true)] public string PrimaryButtonTextColor { get; set; } - + /// /// Gets or Sets PrimaryButtonTextColorHover /// [DataMember(Name = "primary_button_text_color_hover", EmitDefaultValue = true)] public string PrimaryButtonTextColorHover { get; set; } - + /// /// Gets or Sets SecondaryButtonColor /// [DataMember(Name = "secondary_button_color", EmitDefaultValue = true)] public string SecondaryButtonColor { get; set; } - + /// /// Gets or Sets SecondaryButtonColorHover /// [DataMember(Name = "secondary_button_color_hover", EmitDefaultValue = true)] public string SecondaryButtonColorHover { get; set; } - + /// /// Gets or Sets SecondaryButtonTextColor /// [DataMember(Name = "secondary_button_text_color", EmitDefaultValue = true)] public string SecondaryButtonTextColor { get; set; } - + /// /// Gets or Sets SecondaryButtonTextColorHover /// [DataMember(Name = "secondary_button_text_color_hover", EmitDefaultValue = true)] public string SecondaryButtonTextColorHover { get; set; } - + /// /// Gets or Sets TextColor1 /// [DataMember(Name = "text_color1", EmitDefaultValue = true)] public string TextColor1 { get; set; } - + /// /// Gets or Sets TextColor2 /// [DataMember(Name = "text_color2", EmitDefaultValue = true)] public string TextColor2 { get; set; } - + /// /// Returns the string presentation of the object /// @@ -372,6 +372,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -462,16 +471,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ApiAppUpdateRequest.cs b/src/Dropbox.Sign/Model/ApiAppUpdateRequest.cs index 9570c83..68faf35 100644 --- a/src/Dropbox.Sign/Model/ApiAppUpdateRequest.cs +++ b/src/Dropbox.Sign/Model/ApiAppUpdateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ApiAppUpdateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ApiAppUpdateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ApiAppUpdateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -82,46 +82,46 @@ public static ApiAppUpdateRequest Init(string jsonData) /// The URL at which the API App should receive event callbacks. [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + /// /// An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) /// /// An image file to use as a custom logo in embedded contexts. (Only applies to some API plans) [DataMember(Name = "custom_logo_file", EmitDefaultValue = true)] public System.IO.Stream CustomLogoFile { get; set; } - + /// /// The domain names the ApiApp will be associated with. /// /// The domain names the ApiApp will be associated with. [DataMember(Name = "domains", EmitDefaultValue = true)] public List Domains { get; set; } - + /// /// The name you want to assign to the ApiApp. /// /// The name you want to assign to the ApiApp. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Gets or Sets Oauth /// [DataMember(Name = "oauth", EmitDefaultValue = true)] public SubOAuth Oauth { get; set; } - + /// /// Gets or Sets Options /// [DataMember(Name = "options", EmitDefaultValue = true)] public SubOptions Options { get; set; } - + /// /// Gets or Sets WhiteLabelingOptions /// [DataMember(Name = "white_labeling_options", EmitDefaultValue = true)] public SubWhiteLabelingOptions WhiteLabelingOptions { get; set; } - + /// /// Returns the string presentation of the object /// @@ -251,6 +251,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -299,16 +308,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/BulkSendJobGetResponse.cs b/src/Dropbox.Sign/Model/BulkSendJobGetResponse.cs index 947c7cf..80a6c55 100644 --- a/src/Dropbox.Sign/Model/BulkSendJobGetResponse.cs +++ b/src/Dropbox.Sign/Model/BulkSendJobGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "BulkSendJobGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class BulkSendJobGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class BulkSendJobGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,15 +41,30 @@ protected BulkSendJobGetResponse() { } /// /// Initializes a new instance of the class. /// - /// bulkSendJob. - /// listInfo. - /// Contains information about the Signature Requests sent in bulk.. + /// bulkSendJob (required). + /// listInfo (required). + /// Contains information about the Signature Requests sent in bulk. (required). /// A list of warnings.. public BulkSendJobGetResponse(BulkSendJobResponse bulkSendJob = default(BulkSendJobResponse), ListInfoResponse listInfo = default(ListInfoResponse), List signatureRequests = default(List), List warnings = default(List)) { + // to ensure "bulkSendJob" is required (not null) + if (bulkSendJob == null) + { + throw new ArgumentNullException("bulkSendJob is a required property for BulkSendJobGetResponse and cannot be null"); + } this.BulkSendJob = bulkSendJob; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for BulkSendJobGetResponse and cannot be null"); + } this.ListInfo = listInfo; + // to ensure "signatureRequests" is required (not null) + if (signatureRequests == null) + { + throw new ArgumentNullException("signatureRequests is a required property for BulkSendJobGetResponse and cannot be null"); + } this.SignatureRequests = signatureRequests; this.Warnings = warnings; } @@ -73,29 +88,29 @@ public static BulkSendJobGetResponse Init(string jsonData) /// /// Gets or Sets BulkSendJob /// - [DataMember(Name = "bulk_send_job", EmitDefaultValue = true)] + [DataMember(Name = "bulk_send_job", IsRequired = true, EmitDefaultValue = true)] public BulkSendJobResponse BulkSendJob { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { get; set; } - + /// /// Contains information about the Signature Requests sent in bulk. /// /// Contains information about the Signature Requests sent in bulk. - [DataMember(Name = "signature_requests", EmitDefaultValue = true)] + [DataMember(Name = "signature_requests", IsRequired = true, EmitDefaultValue = true)] public List SignatureRequests { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -196,6 +211,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -226,16 +250,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/BulkSendJobGetResponseSignatureRequests.cs b/src/Dropbox.Sign/Model/BulkSendJobGetResponseSignatureRequests.cs index c1a68e6..ba7ff61 100644 --- a/src/Dropbox.Sign/Model/BulkSendJobGetResponseSignatureRequests.cs +++ b/src/Dropbox.Sign/Model/BulkSendJobGetResponseSignatureRequests.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "BulkSendJobGetResponseSignatureRequests")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class BulkSendJobGetResponseSignatureRequests : IOpenApiTyped, IEquatable, IValidatableObject + public partial class BulkSendJobGetResponseSignatureRequests : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -119,175 +119,175 @@ public static BulkSendJobGetResponseSignatureRequests Init(string jsonData) /// Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool? TestMode { get; set; } - + /// /// The id of the SignatureRequest. /// /// The id of the SignatureRequest. [DataMember(Name = "signature_request_id", EmitDefaultValue = true)] public string SignatureRequestId { get; set; } - + /// /// The email address of the initiator of the SignatureRequest. /// /// The email address of the initiator of the SignatureRequest. [DataMember(Name = "requester_email_address", EmitDefaultValue = true)] public string RequesterEmailAddress { get; set; } - + /// /// The title the specified Account uses for the SignatureRequest. /// /// The title the specified Account uses for the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Default Label for account. /// /// Default Label for account. [DataMember(Name = "original_title", EmitDefaultValue = true)] public string OriginalTitle { get; set; } - + /// /// The subject in the email that was initially sent to the signers. /// /// The subject in the email that was initially sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// The custom message in the email that was initially sent to the signers. /// /// The custom message in the email that was initially sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// The metadata attached to the signature request. /// /// The metadata attached to the signature request. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Object Metadata { get; set; } - + /// /// Time the signature request was created. /// /// Time the signature request was created. [DataMember(Name = "created_at", EmitDefaultValue = true)] public int CreatedAt { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Whether or not the SignatureRequest has been fully executed by all signers. /// /// Whether or not the SignatureRequest has been fully executed by all signers. [DataMember(Name = "is_complete", EmitDefaultValue = true)] public bool IsComplete { get; set; } - + /// /// Whether or not the SignatureRequest has been declined by a signer. /// /// Whether or not the SignatureRequest has been declined by a signer. [DataMember(Name = "is_declined", EmitDefaultValue = true)] public bool IsDeclined { get; set; } - + /// /// Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). /// /// Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). [DataMember(Name = "has_error", EmitDefaultValue = true)] public bool HasError { get; set; } - + /// /// The URL where a copy of the request's documents can be downloaded. /// /// The URL where a copy of the request's documents can be downloaded. [DataMember(Name = "files_url", EmitDefaultValue = true)] public string FilesUrl { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "signing_url", EmitDefaultValue = true)] public string SigningUrl { get; set; } - + /// /// The URL where the requester and the signers can view the current status of the SignatureRequest. /// /// The URL where the requester and the signers can view the current status of the SignatureRequest. [DataMember(Name = "details_url", EmitDefaultValue = true)] public string DetailsUrl { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// The URL you want the signer redirected to after they successfully sign. /// /// The URL you want the signer redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The path where the completed document can be downloaded /// /// The path where the completed document can be downloaded [DataMember(Name = "final_copy_uri", EmitDefaultValue = true)] public string FinalCopyUri { get; set; } - + /// /// Templates IDs used in this SignatureRequest (if any). /// /// Templates IDs used in this SignatureRequest (if any). [DataMember(Name = "template_ids", EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` /// /// An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Signer attachments. /// /// Signer attachments. [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. /// /// An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. [DataMember(Name = "response_data", EmitDefaultValue = true)] public List ResponseData { get; set; } - + /// /// An array of signature objects, 1 for each signer. /// /// An array of signature objects, 1 for each signer. [DataMember(Name = "signatures", EmitDefaultValue = true)] public List Signatures { get; set; } - + /// /// The id of the BulkSendJob. /// /// The id of the BulkSendJob. [DataMember(Name = "bulk_send_job_id", EmitDefaultValue = true)] public string BulkSendJobId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -582,6 +582,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -738,16 +747,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/BulkSendJobListResponse.cs b/src/Dropbox.Sign/Model/BulkSendJobListResponse.cs index 4840c1b..51dff2a 100644 --- a/src/Dropbox.Sign/Model/BulkSendJobListResponse.cs +++ b/src/Dropbox.Sign/Model/BulkSendJobListResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "BulkSendJobListResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class BulkSendJobListResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class BulkSendJobListResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected BulkSendJobListResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains a list of BulkSendJobs that the API caller has access to.. - /// listInfo. + /// Contains a list of BulkSendJobs that the API caller has access to. (required). + /// listInfo (required). /// A list of warnings.. public BulkSendJobListResponse(List bulkSendJobs = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "bulkSendJobs" is required (not null) + if (bulkSendJobs == null) + { + throw new ArgumentNullException("bulkSendJobs is a required property for BulkSendJobListResponse and cannot be null"); + } this.BulkSendJobs = bulkSendJobs; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for BulkSendJobListResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,22 +82,22 @@ public static BulkSendJobListResponse Init(string jsonData) /// Contains a list of BulkSendJobs that the API caller has access to. /// /// Contains a list of BulkSendJobs that the API caller has access to. - [DataMember(Name = "bulk_send_jobs", EmitDefaultValue = true)] + [DataMember(Name = "bulk_send_jobs", IsRequired = true, EmitDefaultValue = true)] public List BulkSendJobs { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -178,6 +188,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -202,16 +221,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/BulkSendJobResponse.cs b/src/Dropbox.Sign/Model/BulkSendJobResponse.cs index 42d178e..a471d66 100644 --- a/src/Dropbox.Sign/Model/BulkSendJobResponse.cs +++ b/src/Dropbox.Sign/Model/BulkSendJobResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "BulkSendJobResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class BulkSendJobResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class BulkSendJobResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,28 +76,28 @@ public static BulkSendJobResponse Init(string jsonData) /// The id of the BulkSendJob. [DataMember(Name = "bulk_send_job_id", EmitDefaultValue = true)] public string BulkSendJobId { get; set; } - + /// /// The total amount of Signature Requests queued for sending. /// /// The total amount of Signature Requests queued for sending. [DataMember(Name = "total", EmitDefaultValue = true)] public int Total { get; set; } - + /// /// True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. /// /// True if you are the owner of this BulkSendJob, false if it's been shared with you by a team member. [DataMember(Name = "is_creator", EmitDefaultValue = true)] public bool IsCreator { get; set; } - + /// /// Time that the BulkSendJob was created. /// /// Time that the BulkSendJob was created. [DataMember(Name = "created_at", EmitDefaultValue = true)] public int CreatedAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -184,6 +184,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -214,16 +223,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/BulkSendJobSendResponse.cs b/src/Dropbox.Sign/Model/BulkSendJobSendResponse.cs index 8cb4ec3..ff2af86 100644 --- a/src/Dropbox.Sign/Model/BulkSendJobSendResponse.cs +++ b/src/Dropbox.Sign/Model/BulkSendJobSendResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "BulkSendJobSendResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class BulkSendJobSendResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class BulkSendJobSendResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected BulkSendJobSendResponse() { } /// /// Initializes a new instance of the class. /// - /// bulkSendJob. + /// bulkSendJob (required). /// A list of warnings.. public BulkSendJobSendResponse(BulkSendJobResponse bulkSendJob = default(BulkSendJobResponse), List warnings = default(List)) { + // to ensure "bulkSendJob" is required (not null) + if (bulkSendJob == null) + { + throw new ArgumentNullException("bulkSendJob is a required property for BulkSendJobSendResponse and cannot be null"); + } this.BulkSendJob = bulkSendJob; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static BulkSendJobSendResponse Init(string jsonData) /// /// Gets or Sets BulkSendJob /// - [DataMember(Name = "bulk_send_job", EmitDefaultValue = true)] + [DataMember(Name = "bulk_send_job", IsRequired = true, EmitDefaultValue = true)] public BulkSendJobResponse BulkSendJob { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/EmbeddedEditUrlRequest.cs b/src/Dropbox.Sign/Model/EmbeddedEditUrlRequest.cs index 7551347..a8af5ce 100644 --- a/src/Dropbox.Sign/Model/EmbeddedEditUrlRequest.cs +++ b/src/Dropbox.Sign/Model/EmbeddedEditUrlRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EmbeddedEditUrlRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EmbeddedEditUrlRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EmbeddedEditUrlRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -88,69 +88,69 @@ public static EmbeddedEditUrlRequest Init(string jsonData) /// This allows the requester to enable/disable to add or change CC roles when editing the template. [DataMember(Name = "allow_edit_ccs", EmitDefaultValue = true)] public bool AllowEditCcs { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "cc_roles", EmitDefaultValue = true)] public List CcRoles { get; set; } - + /// /// Gets or Sets EditorOptions /// [DataMember(Name = "editor_options", EmitDefaultValue = true)] public SubEditorOptions EditorOptions { get; set; } - + /// /// Provide users the ability to review/edit the template signer roles. /// /// Provide users the ability to review/edit the template signer roles. [DataMember(Name = "force_signer_roles", EmitDefaultValue = true)] public bool ForceSignerRoles { get; set; } - + /// /// Provide users the ability to review/edit the template subject and message. /// /// Provide users the ability to review/edit the template subject and message. [DataMember(Name = "force_subject_message", EmitDefaultValue = true)] public bool ForceSubjectMessage { get; set; } - + /// /// 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 `[]`. /// /// 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 `[]`. [DataMember(Name = "merge_fields", EmitDefaultValue = true)] public List MergeFields { get; set; } - + /// /// 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). /// /// 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). [DataMember(Name = "preview_only", EmitDefaultValue = true)] public bool PreviewOnly { get; set; } - + /// /// This allows the requester to enable the editor/preview experience. /// /// This allows the requester to enable the editor/preview experience. [DataMember(Name = "show_preview", EmitDefaultValue = true)] public bool ShowPreview { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. /// /// Whether this is a test, locked templates will only be available for editing if this is set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// Returns the string presentation of the object /// @@ -283,6 +283,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -349,16 +358,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/EmbeddedEditUrlResponse.cs b/src/Dropbox.Sign/Model/EmbeddedEditUrlResponse.cs index 6e9da6f..27ff9ff 100644 --- a/src/Dropbox.Sign/Model/EmbeddedEditUrlResponse.cs +++ b/src/Dropbox.Sign/Model/EmbeddedEditUrlResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EmbeddedEditUrlResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EmbeddedEditUrlResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EmbeddedEditUrlResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected EmbeddedEditUrlResponse() { } /// /// Initializes a new instance of the class. /// - /// embedded. + /// embedded (required). /// A list of warnings.. public EmbeddedEditUrlResponse(EmbeddedEditUrlResponseEmbedded embedded = default(EmbeddedEditUrlResponseEmbedded), List warnings = default(List)) { + // to ensure "embedded" is required (not null) + if (embedded == null) + { + throw new ArgumentNullException("embedded is a required property for EmbeddedEditUrlResponse and cannot be null"); + } this.Embedded = embedded; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static EmbeddedEditUrlResponse Init(string jsonData) /// /// Gets or Sets Embedded /// - [DataMember(Name = "embedded", EmitDefaultValue = true)] + [DataMember(Name = "embedded", IsRequired = true, EmitDefaultValue = true)] public EmbeddedEditUrlResponseEmbedded Embedded { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/EmbeddedEditUrlResponseEmbedded.cs b/src/Dropbox.Sign/Model/EmbeddedEditUrlResponseEmbedded.cs index 1f961bb..39d86c9 100644 --- a/src/Dropbox.Sign/Model/EmbeddedEditUrlResponseEmbedded.cs +++ b/src/Dropbox.Sign/Model/EmbeddedEditUrlResponseEmbedded.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EmbeddedEditUrlResponseEmbedded")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EmbeddedEditUrlResponseEmbedded : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EmbeddedEditUrlResponseEmbedded : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static EmbeddedEditUrlResponseEmbedded Init(string jsonData) /// A template url that can be opened in an iFrame. [DataMember(Name = "edit_url", EmitDefaultValue = true)] public string EditUrl { get; set; } - + /// /// The specific time that the the `edit_url` link expires, in epoch. /// /// The specific time that the the `edit_url` link expires, in epoch. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -154,6 +154,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -172,16 +181,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/EmbeddedSignUrlResponse.cs b/src/Dropbox.Sign/Model/EmbeddedSignUrlResponse.cs index 554b2d2..6e7f347 100644 --- a/src/Dropbox.Sign/Model/EmbeddedSignUrlResponse.cs +++ b/src/Dropbox.Sign/Model/EmbeddedSignUrlResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EmbeddedSignUrlResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EmbeddedSignUrlResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EmbeddedSignUrlResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected EmbeddedSignUrlResponse() { } /// /// Initializes a new instance of the class. /// - /// embedded. + /// embedded (required). /// A list of warnings.. public EmbeddedSignUrlResponse(EmbeddedSignUrlResponseEmbedded embedded = default(EmbeddedSignUrlResponseEmbedded), List warnings = default(List)) { + // to ensure "embedded" is required (not null) + if (embedded == null) + { + throw new ArgumentNullException("embedded is a required property for EmbeddedSignUrlResponse and cannot be null"); + } this.Embedded = embedded; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static EmbeddedSignUrlResponse Init(string jsonData) /// /// Gets or Sets Embedded /// - [DataMember(Name = "embedded", EmitDefaultValue = true)] + [DataMember(Name = "embedded", IsRequired = true, EmitDefaultValue = true)] public EmbeddedSignUrlResponseEmbedded Embedded { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/EmbeddedSignUrlResponseEmbedded.cs b/src/Dropbox.Sign/Model/EmbeddedSignUrlResponseEmbedded.cs index 6d67035..ae0834e 100644 --- a/src/Dropbox.Sign/Model/EmbeddedSignUrlResponseEmbedded.cs +++ b/src/Dropbox.Sign/Model/EmbeddedSignUrlResponseEmbedded.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EmbeddedSignUrlResponseEmbedded")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EmbeddedSignUrlResponseEmbedded : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EmbeddedSignUrlResponseEmbedded : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static EmbeddedSignUrlResponseEmbedded Init(string jsonData) /// A signature url that can be opened in an iFrame. [DataMember(Name = "sign_url", EmitDefaultValue = true)] public string SignUrl { get; set; } - + /// /// The specific time that the the `sign_url` link expires, in epoch. /// /// The specific time that the the `sign_url` link expires, in epoch. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -154,6 +154,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -172,16 +181,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ErrorResponse.cs b/src/Dropbox.Sign/Model/ErrorResponse.cs index 3f52837..7a89dff 100644 --- a/src/Dropbox.Sign/Model/ErrorResponse.cs +++ b/src/Dropbox.Sign/Model/ErrorResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ErrorResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ErrorResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ErrorResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -74,7 +74,7 @@ public static ErrorResponse Init(string jsonData) /// [DataMember(Name = "error", IsRequired = true, EmitDefaultValue = true)] public ErrorResponseError Error { get; set; } - + /// /// Returns the string presentation of the object /// @@ -143,6 +143,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -155,16 +164,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ErrorResponseError.cs b/src/Dropbox.Sign/Model/ErrorResponseError.cs index b7ec7a6..15c9f7a 100644 --- a/src/Dropbox.Sign/Model/ErrorResponseError.cs +++ b/src/Dropbox.Sign/Model/ErrorResponseError.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ErrorResponseError")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ErrorResponseError : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ErrorResponseError : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -84,21 +84,21 @@ public static ErrorResponseError Init(string jsonData) /// Message describing an error. [DataMember(Name = "error_msg", IsRequired = true, EmitDefaultValue = true)] public string ErrorMsg { get; set; } - + /// /// Name of the error. /// /// Name of the error. [DataMember(Name = "error_name", IsRequired = true, EmitDefaultValue = true)] public string ErrorName { get; set; } - + /// /// Path at which an error occurred. /// /// Path at which an error occurred. [DataMember(Name = "error_path", EmitDefaultValue = true)] public string ErrorPath { get; set; } - + /// /// Returns the string presentation of the object /// @@ -187,6 +187,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -211,16 +220,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/EventCallbackRequest.cs b/src/Dropbox.Sign/Model/EventCallbackRequest.cs index d8b0744..dbe451c 100644 --- a/src/Dropbox.Sign/Model/EventCallbackRequest.cs +++ b/src/Dropbox.Sign/Model/EventCallbackRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EventCallbackRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EventCallbackRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EventCallbackRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,19 +41,19 @@ protected EventCallbackRequest() { } /// /// Initializes a new instance of the class. /// - /// _event (required). + /// varEvent (required). /// account. /// signatureRequest. /// template. - public EventCallbackRequest(EventCallbackRequestEvent _event = default(EventCallbackRequestEvent), AccountResponse account = default(AccountResponse), SignatureRequestResponse signatureRequest = default(SignatureRequestResponse), TemplateResponse template = default(TemplateResponse)) + public EventCallbackRequest(EventCallbackRequestEvent varEvent = default(EventCallbackRequestEvent), AccountResponse account = default(AccountResponse), SignatureRequestResponse signatureRequest = default(SignatureRequestResponse), TemplateResponse template = default(TemplateResponse)) { - // to ensure "_event" is required (not null) - if (_event == null) + // to ensure "varEvent" is required (not null) + if (varEvent == null) { - throw new ArgumentNullException("_event is a required property for EventCallbackRequest and cannot be null"); + throw new ArgumentNullException("varEvent is a required property for EventCallbackRequest and cannot be null"); } - this.Event = _event; + this.Event = varEvent; this.Account = account; this.SignatureRequest = signatureRequest; this.Template = template; @@ -80,25 +80,25 @@ public static EventCallbackRequest Init(string jsonData) /// [DataMember(Name = "event", IsRequired = true, EmitDefaultValue = true)] public EventCallbackRequestEvent Event { get; set; } - + /// /// Gets or Sets Account /// [DataMember(Name = "account", EmitDefaultValue = true)] public AccountResponse Account { get; set; } - + /// /// Gets or Sets SignatureRequest /// [DataMember(Name = "signature_request", EmitDefaultValue = true)] public SignatureRequestResponse SignatureRequest { get; set; } - + /// /// Gets or Sets Template /// [DataMember(Name = "template", EmitDefaultValue = true)] public TemplateResponse Template { get; set; } - + /// /// Returns the string presentation of the object /// @@ -197,6 +197,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -227,16 +236,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/EventCallbackRequestEvent.cs b/src/Dropbox.Sign/Model/EventCallbackRequestEvent.cs index 9513fff..3058970 100644 --- a/src/Dropbox.Sign/Model/EventCallbackRequestEvent.cs +++ b/src/Dropbox.Sign/Model/EventCallbackRequestEvent.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EventCallbackRequestEvent")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EventCallbackRequestEvent : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EventCallbackRequestEvent : IEquatable, IValidatableObject { /// /// Type of callback event that was triggered. @@ -177,7 +177,6 @@ public enum EventTypeEnum /// [EnumMember(Value = "signature_request_signer_removed")] SignatureRequestSignerRemoved = 23 - } @@ -240,20 +239,20 @@ public static EventCallbackRequestEvent Init(string jsonData) /// Time the event was created (using Unix time). [DataMember(Name = "event_time", IsRequired = true, EmitDefaultValue = true)] public string EventTime { get; set; } - + /// /// Generated hash used to verify source of event data. /// /// Generated hash used to verify source of event data. [DataMember(Name = "event_hash", IsRequired = true, EmitDefaultValue = true)] public string EventHash { get; set; } - + /// /// Gets or Sets EventMetadata /// [DataMember(Name = "event_metadata", EmitDefaultValue = true)] public EventCallbackRequestEventMetadata EventMetadata { get; set; } - + /// /// Returns the string presentation of the object /// @@ -348,6 +347,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -378,16 +386,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/EventCallbackRequestEventMetadata.cs b/src/Dropbox.Sign/Model/EventCallbackRequestEventMetadata.cs index 5b0aaf5..f3993c4 100644 --- a/src/Dropbox.Sign/Model/EventCallbackRequestEventMetadata.cs +++ b/src/Dropbox.Sign/Model/EventCallbackRequestEventMetadata.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "EventCallbackRequestEventMetadata")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class EventCallbackRequestEventMetadata : IOpenApiTyped, IEquatable, IValidatableObject + public partial class EventCallbackRequestEventMetadata : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,28 +76,28 @@ public static EventCallbackRequestEventMetadata Init(string jsonData) /// Signature ID for a specific signer. Applicable to `signature_request_signed` and `signature_request_viewed` events. [DataMember(Name = "related_signature_id", EmitDefaultValue = true)] public string RelatedSignatureId { get; set; } - + /// /// Account ID the event was reported for. /// /// Account ID the event was reported for. [DataMember(Name = "reported_for_account_id", EmitDefaultValue = true)] public string ReportedForAccountId { get; set; } - + /// /// App ID the event was reported for. /// /// App ID the event was reported for. [DataMember(Name = "reported_for_app_id", EmitDefaultValue = true)] public string ReportedForAppId { get; set; } - + /// /// Message about a declined or failed (due to error) signature flow. /// /// Message about a declined or failed (due to error) signature flow. [DataMember(Name = "event_message", EmitDefaultValue = true)] public string EventMessage { get; set; } - + /// /// Returns the string presentation of the object /// @@ -196,6 +196,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -226,16 +235,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/FaxLine.cs b/src/Dropbox.Sign/Model/FaxLine.cs new file mode 100644 index 0000000..8ded1b1 --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLine.cs @@ -0,0 +1,241 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// FaxLine + /// + [DataContract(Name = "FaxLine")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLine : IOpenApiTyped, IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLine() { } + /// + /// Initializes a new instance of the class. + /// + /// Number. + /// Created at. + /// Updated at. + /// accounts. + public FaxLine(string number = default(string), string createdAt = default(string), string updatedAt = default(string), List accounts = default(List)) + { + + this.Number = number; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.Accounts = accounts; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLine Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLine"); + } + + return obj; + } + + /// + /// Number + /// + /// Number + [DataMember(Name = "number", EmitDefaultValue = true)] + public string Number { get; set; } + + /// + /// Created at + /// + /// Created at + [DataMember(Name = "created_at", EmitDefaultValue = true)] + public string CreatedAt { get; set; } + + /// + /// Updated at + /// + /// Updated at + [DataMember(Name = "updated_at", EmitDefaultValue = true)] + public string UpdatedAt { get; set; } + + /// + /// Gets or Sets Accounts + /// + [DataMember(Name = "accounts", EmitDefaultValue = true)] + public List Accounts { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxLine {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n"); + sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n"); + sb.Append(" Accounts: ").Append(Accounts).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FaxLine); + } + + /// + /// Returns true if FaxLine instances are equal + /// + /// Instance of FaxLine to be compared + /// Boolean + public bool Equals(FaxLine input) + { + if (input == null) + { + return false; + } + return + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.CreatedAt == input.CreatedAt || + (this.CreatedAt != null && + this.CreatedAt.Equals(input.CreatedAt)) + ) && + ( + this.UpdatedAt == input.UpdatedAt || + (this.UpdatedAt != null && + this.UpdatedAt.Equals(input.UpdatedAt)) + ) && + ( + this.Accounts == input.Accounts || + this.Accounts != null && + input.Accounts != null && + this.Accounts.SequenceEqual(input.Accounts) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + if (this.CreatedAt != null) + { + hashCode = (hashCode * 59) + this.CreatedAt.GetHashCode(); + } + if (this.UpdatedAt != null) + { + hashCode = (hashCode * 59) + this.UpdatedAt.GetHashCode(); + } + if (this.Accounts != null) + { + hashCode = (hashCode * 59) + this.Accounts.GetHashCode(); + } + return hashCode; + } + } + + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "number", + Property = "Number", + Type = "string", + Value = Number, + }); + types.Add(new OpenApiType(){ + Name = "created_at", + Property = "CreatedAt", + Type = "string", + Value = CreatedAt, + }); + types.Add(new OpenApiType(){ + Name = "updated_at", + Property = "UpdatedAt", + Type = "string", + Value = UpdatedAt, + }); + types.Add(new OpenApiType(){ + Name = "accounts", + Property = "Accounts", + Type = "List", + Value = Accounts, + }); + + return types; + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + public IEnumerable Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs b/src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs new file mode 100644 index 0000000..564561b --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLineAddUserRequest.cs @@ -0,0 +1,221 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// FaxLineAddUserRequest + /// + [DataContract(Name = "FaxLineAddUserRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineAddUserRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineAddUserRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// The Fax Line number. (required). + /// Account ID. + /// Email address. + public FaxLineAddUserRequest(string number = default(string), string accountId = default(string), string emailAddress = default(string)) + { + + // to ensure "number" is required (not null) + if (number == null) + { + throw new ArgumentNullException("number is a required property for FaxLineAddUserRequest and cannot be null"); + } + this.Number = number; + this.AccountId = accountId; + this.EmailAddress = emailAddress; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineAddUserRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineAddUserRequest"); + } + + return obj; + } + + /// + /// The Fax Line number. + /// + /// The Fax Line number. + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = true)] + public string Number { get; set; } + + /// + /// Account ID + /// + /// Account ID + /// ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + [DataMember(Name = "account_id", EmitDefaultValue = true)] + public string AccountId { get; set; } + + /// + /// Email address + /// + /// Email address + [DataMember(Name = "email_address", EmitDefaultValue = true)] + public string EmailAddress { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxLineAddUserRequest {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" AccountId: ").Append(AccountId).Append("\n"); + sb.Append(" EmailAddress: ").Append(EmailAddress).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FaxLineAddUserRequest); + } + + /// + /// Returns true if FaxLineAddUserRequest instances are equal + /// + /// Instance of FaxLineAddUserRequest to be compared + /// Boolean + public bool Equals(FaxLineAddUserRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.AccountId == input.AccountId || + (this.AccountId != null && + this.AccountId.Equals(input.AccountId)) + ) && + ( + this.EmailAddress == input.EmailAddress || + (this.EmailAddress != null && + this.EmailAddress.Equals(input.EmailAddress)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + if (this.AccountId != null) + { + hashCode = (hashCode * 59) + this.AccountId.GetHashCode(); + } + if (this.EmailAddress != null) + { + hashCode = (hashCode * 59) + this.EmailAddress.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "number", + Property = "Number", + Type = "string", + Value = Number, + }); + types.Add(new OpenApiType(){ + Name = "account_id", + Property = "AccountId", + Type = "string", + Value = AccountId, + }); + types.Add(new OpenApiType(){ + Name = "email_address", + Property = "EmailAddress", + Type = "string", + Value = EmailAddress, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/FaxLineAreaCodeGetCountryEnum.cs b/src/Dropbox.Sign/Model/FaxLineAreaCodeGetCountryEnum.cs new file mode 100644 index 0000000..bf41606 --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLineAreaCodeGetCountryEnum.cs @@ -0,0 +1,54 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// Defines FaxLineAreaCodeGetCountryEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FaxLineAreaCodeGetCountryEnum + { + /// + /// Enum CA for value: CA + /// + [EnumMember(Value = "CA")] + CA = 1, + + /// + /// Enum US for value: US + /// + [EnumMember(Value = "US")] + US = 2, + + /// + /// Enum UK for value: UK + /// + [EnumMember(Value = "UK")] + UK = 3 + } + +} diff --git a/src/Dropbox.Sign/Model/FaxLineAreaCodeGetProvinceEnum.cs b/src/Dropbox.Sign/Model/FaxLineAreaCodeGetProvinceEnum.cs new file mode 100644 index 0000000..1179ce0 --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLineAreaCodeGetProvinceEnum.cs @@ -0,0 +1,114 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// Defines FaxLineAreaCodeGetProvinceEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FaxLineAreaCodeGetProvinceEnum + { + /// + /// Enum AB for value: AB + /// + [EnumMember(Value = "AB")] + AB = 1, + + /// + /// Enum BC for value: BC + /// + [EnumMember(Value = "BC")] + BC = 2, + + /// + /// Enum MB for value: MB + /// + [EnumMember(Value = "MB")] + MB = 3, + + /// + /// Enum NB for value: NB + /// + [EnumMember(Value = "NB")] + NB = 4, + + /// + /// Enum NL for value: NL + /// + [EnumMember(Value = "NL")] + NL = 5, + + /// + /// Enum NT for value: NT + /// + [EnumMember(Value = "NT")] + NT = 6, + + /// + /// Enum NS for value: NS + /// + [EnumMember(Value = "NS")] + NS = 7, + + /// + /// Enum NU for value: NU + /// + [EnumMember(Value = "NU")] + NU = 8, + + /// + /// Enum ON for value: ON + /// + [EnumMember(Value = "ON")] + ON = 9, + + /// + /// Enum PE for value: PE + /// + [EnumMember(Value = "PE")] + PE = 10, + + /// + /// Enum QC for value: QC + /// + [EnumMember(Value = "QC")] + QC = 11, + + /// + /// Enum SK for value: SK + /// + [EnumMember(Value = "SK")] + SK = 12, + + /// + /// Enum YT for value: YT + /// + [EnumMember(Value = "YT")] + YT = 13 + } + +} diff --git a/src/Dropbox.Sign/Model/FaxLineAreaCodeGetResponse.cs b/src/Dropbox.Sign/Model/FaxLineAreaCodeGetResponse.cs new file mode 100644 index 0000000..f4224f0 --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLineAreaCodeGetResponse.cs @@ -0,0 +1,170 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// FaxLineAreaCodeGetResponse + /// + [DataContract(Name = "FaxLineAreaCodeGetResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineAreaCodeGetResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineAreaCodeGetResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// areaCodes (required). + public FaxLineAreaCodeGetResponse(List areaCodes = default(List)) + { + + // to ensure "areaCodes" is required (not null) + if (areaCodes == null) + { + throw new ArgumentNullException("areaCodes is a required property for FaxLineAreaCodeGetResponse and cannot be null"); + } + this.AreaCodes = areaCodes; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineAreaCodeGetResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineAreaCodeGetResponse"); + } + + return obj; + } + + /// + /// Gets or Sets AreaCodes + /// + [DataMember(Name = "area_codes", IsRequired = true, EmitDefaultValue = true)] + public List AreaCodes { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxLineAreaCodeGetResponse {\n"); + sb.Append(" AreaCodes: ").Append(AreaCodes).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FaxLineAreaCodeGetResponse); + } + + /// + /// Returns true if FaxLineAreaCodeGetResponse instances are equal + /// + /// Instance of FaxLineAreaCodeGetResponse to be compared + /// Boolean + public bool Equals(FaxLineAreaCodeGetResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.AreaCodes == input.AreaCodes || + this.AreaCodes != null && + input.AreaCodes != null && + this.AreaCodes.SequenceEqual(input.AreaCodes) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AreaCodes != null) + { + hashCode = (hashCode * 59) + this.AreaCodes.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "area_codes", + Property = "AreaCodes", + Type = "List", + Value = AreaCodes, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/FaxLineAreaCodeGetStateEnum.cs b/src/Dropbox.Sign/Model/FaxLineAreaCodeGetStateEnum.cs new file mode 100644 index 0000000..c62661b --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLineAreaCodeGetStateEnum.cs @@ -0,0 +1,342 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// Defines FaxLineAreaCodeGetStateEnum + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FaxLineAreaCodeGetStateEnum + { + /// + /// Enum AK for value: AK + /// + [EnumMember(Value = "AK")] + AK = 1, + + /// + /// Enum AL for value: AL + /// + [EnumMember(Value = "AL")] + AL = 2, + + /// + /// Enum AR for value: AR + /// + [EnumMember(Value = "AR")] + AR = 3, + + /// + /// Enum AZ for value: AZ + /// + [EnumMember(Value = "AZ")] + AZ = 4, + + /// + /// Enum CA for value: CA + /// + [EnumMember(Value = "CA")] + CA = 5, + + /// + /// Enum CO for value: CO + /// + [EnumMember(Value = "CO")] + CO = 6, + + /// + /// Enum CT for value: CT + /// + [EnumMember(Value = "CT")] + CT = 7, + + /// + /// Enum DC for value: DC + /// + [EnumMember(Value = "DC")] + DC = 8, + + /// + /// Enum DE for value: DE + /// + [EnumMember(Value = "DE")] + DE = 9, + + /// + /// Enum FL for value: FL + /// + [EnumMember(Value = "FL")] + FL = 10, + + /// + /// Enum GA for value: GA + /// + [EnumMember(Value = "GA")] + GA = 11, + + /// + /// Enum HI for value: HI + /// + [EnumMember(Value = "HI")] + HI = 12, + + /// + /// Enum IA for value: IA + /// + [EnumMember(Value = "IA")] + IA = 13, + + /// + /// Enum ID for value: ID + /// + [EnumMember(Value = "ID")] + ID = 14, + + /// + /// Enum IL for value: IL + /// + [EnumMember(Value = "IL")] + IL = 15, + + /// + /// Enum IN for value: IN + /// + [EnumMember(Value = "IN")] + IN = 16, + + /// + /// Enum KS for value: KS + /// + [EnumMember(Value = "KS")] + KS = 17, + + /// + /// Enum KY for value: KY + /// + [EnumMember(Value = "KY")] + KY = 18, + + /// + /// Enum LA for value: LA + /// + [EnumMember(Value = "LA")] + LA = 19, + + /// + /// Enum MA for value: MA + /// + [EnumMember(Value = "MA")] + MA = 20, + + /// + /// Enum MD for value: MD + /// + [EnumMember(Value = "MD")] + MD = 21, + + /// + /// Enum ME for value: ME + /// + [EnumMember(Value = "ME")] + ME = 22, + + /// + /// Enum MI for value: MI + /// + [EnumMember(Value = "MI")] + MI = 23, + + /// + /// Enum MN for value: MN + /// + [EnumMember(Value = "MN")] + MN = 24, + + /// + /// Enum MO for value: MO + /// + [EnumMember(Value = "MO")] + MO = 25, + + /// + /// Enum MS for value: MS + /// + [EnumMember(Value = "MS")] + MS = 26, + + /// + /// Enum MT for value: MT + /// + [EnumMember(Value = "MT")] + MT = 27, + + /// + /// Enum NC for value: NC + /// + [EnumMember(Value = "NC")] + NC = 28, + + /// + /// Enum ND for value: ND + /// + [EnumMember(Value = "ND")] + ND = 29, + + /// + /// Enum NE for value: NE + /// + [EnumMember(Value = "NE")] + NE = 30, + + /// + /// Enum NH for value: NH + /// + [EnumMember(Value = "NH")] + NH = 31, + + /// + /// Enum NJ for value: NJ + /// + [EnumMember(Value = "NJ")] + NJ = 32, + + /// + /// Enum NM for value: NM + /// + [EnumMember(Value = "NM")] + NM = 33, + + /// + /// Enum NV for value: NV + /// + [EnumMember(Value = "NV")] + NV = 34, + + /// + /// Enum NY for value: NY + /// + [EnumMember(Value = "NY")] + NY = 35, + + /// + /// Enum OH for value: OH + /// + [EnumMember(Value = "OH")] + OH = 36, + + /// + /// Enum OK for value: OK + /// + [EnumMember(Value = "OK")] + OK = 37, + + /// + /// Enum OR for value: OR + /// + [EnumMember(Value = "OR")] + OR = 38, + + /// + /// Enum PA for value: PA + /// + [EnumMember(Value = "PA")] + PA = 39, + + /// + /// Enum RI for value: RI + /// + [EnumMember(Value = "RI")] + RI = 40, + + /// + /// Enum SC for value: SC + /// + [EnumMember(Value = "SC")] + SC = 41, + + /// + /// Enum SD for value: SD + /// + [EnumMember(Value = "SD")] + SD = 42, + + /// + /// Enum TN for value: TN + /// + [EnumMember(Value = "TN")] + TN = 43, + + /// + /// Enum TX for value: TX + /// + [EnumMember(Value = "TX")] + TX = 44, + + /// + /// Enum UT for value: UT + /// + [EnumMember(Value = "UT")] + UT = 45, + + /// + /// Enum VA for value: VA + /// + [EnumMember(Value = "VA")] + VA = 46, + + /// + /// Enum VT for value: VT + /// + [EnumMember(Value = "VT")] + VT = 47, + + /// + /// Enum WA for value: WA + /// + [EnumMember(Value = "WA")] + WA = 48, + + /// + /// Enum WI for value: WI + /// + [EnumMember(Value = "WI")] + WI = 49, + + /// + /// Enum WV for value: WV + /// + [EnumMember(Value = "WV")] + WV = 50, + + /// + /// Enum WY for value: WY + /// + [EnumMember(Value = "WY")] + WY = 51 + } + +} diff --git a/src/Dropbox.Sign/Model/FaxLineCreateRequest.cs b/src/Dropbox.Sign/Model/FaxLineCreateRequest.cs new file mode 100644 index 0000000..0f7157d --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLineCreateRequest.cs @@ -0,0 +1,259 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// FaxLineCreateRequest + /// + [DataContract(Name = "FaxLineCreateRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineCreateRequest : IEquatable, IValidatableObject + { + /// + /// Country + /// + /// Country + [JsonConverter(typeof(StringEnumConverter))] + public enum CountryEnum + { + /// + /// Enum CA for value: CA + /// + [EnumMember(Value = "CA")] + CA = 1, + + /// + /// Enum US for value: US + /// + [EnumMember(Value = "US")] + US = 2, + + /// + /// Enum UK for value: UK + /// + [EnumMember(Value = "UK")] + UK = 3 + } + + + /// + /// Country + /// + /// Country + [DataMember(Name = "country", IsRequired = true, EmitDefaultValue = true)] + public CountryEnum Country { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineCreateRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// Area code (required). + /// Country (required). + /// City. + /// Account ID. + public FaxLineCreateRequest(int areaCode = default(int), CountryEnum country = default(CountryEnum), string city = default(string), string accountId = default(string)) + { + + this.AreaCode = areaCode; + this.Country = country; + this.City = city; + this.AccountId = accountId; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineCreateRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineCreateRequest"); + } + + return obj; + } + + /// + /// Area code + /// + /// Area code + [DataMember(Name = "area_code", IsRequired = true, EmitDefaultValue = true)] + public int AreaCode { get; set; } + + /// + /// City + /// + /// City + [DataMember(Name = "city", EmitDefaultValue = true)] + public string City { get; set; } + + /// + /// Account ID + /// + /// Account ID + /// ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + [DataMember(Name = "account_id", EmitDefaultValue = true)] + public string AccountId { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxLineCreateRequest {\n"); + sb.Append(" AreaCode: ").Append(AreaCode).Append("\n"); + sb.Append(" Country: ").Append(Country).Append("\n"); + sb.Append(" City: ").Append(City).Append("\n"); + sb.Append(" AccountId: ").Append(AccountId).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FaxLineCreateRequest); + } + + /// + /// Returns true if FaxLineCreateRequest instances are equal + /// + /// Instance of FaxLineCreateRequest to be compared + /// Boolean + public bool Equals(FaxLineCreateRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.AreaCode == input.AreaCode || + this.AreaCode.Equals(input.AreaCode) + ) && + ( + this.Country == input.Country || + this.Country.Equals(input.Country) + ) && + ( + this.City == input.City || + (this.City != null && + this.City.Equals(input.City)) + ) && + ( + this.AccountId == input.AccountId || + (this.AccountId != null && + this.AccountId.Equals(input.AccountId)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + hashCode = (hashCode * 59) + this.AreaCode.GetHashCode(); + hashCode = (hashCode * 59) + this.Country.GetHashCode(); + if (this.City != null) + { + hashCode = (hashCode * 59) + this.City.GetHashCode(); + } + if (this.AccountId != null) + { + hashCode = (hashCode * 59) + this.AccountId.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "area_code", + Property = "AreaCode", + Type = "int", + Value = AreaCode, + }); + types.Add(new OpenApiType(){ + Name = "country", + Property = "Country", + Type = "string", + Value = Country, + }); + types.Add(new OpenApiType(){ + Name = "city", + Property = "City", + Type = "string", + Value = City, + }); + types.Add(new OpenApiType(){ + Name = "account_id", + Property = "AccountId", + Type = "string", + Value = AccountId, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs b/src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs new file mode 100644 index 0000000..b806f21 --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLineDeleteRequest.cs @@ -0,0 +1,170 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// FaxLineDeleteRequest + /// + [DataContract(Name = "FaxLineDeleteRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineDeleteRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineDeleteRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// The Fax Line number. (required). + public FaxLineDeleteRequest(string number = default(string)) + { + + // to ensure "number" is required (not null) + if (number == null) + { + throw new ArgumentNullException("number is a required property for FaxLineDeleteRequest and cannot be null"); + } + this.Number = number; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineDeleteRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineDeleteRequest"); + } + + return obj; + } + + /// + /// The Fax Line number. + /// + /// The Fax Line number. + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = true)] + public string Number { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxLineDeleteRequest {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FaxLineDeleteRequest); + } + + /// + /// Returns true if FaxLineDeleteRequest instances are equal + /// + /// Instance of FaxLineDeleteRequest to be compared + /// Boolean + public bool Equals(FaxLineDeleteRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "number", + Property = "Number", + Type = "string", + Value = Number, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/FaxLineListResponse.cs b/src/Dropbox.Sign/Model/FaxLineListResponse.cs new file mode 100644 index 0000000..25bd1f7 --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLineListResponse.cs @@ -0,0 +1,223 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// FaxLineListResponse + /// + [DataContract(Name = "FaxLineListResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineListResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineListResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// listInfo (required). + /// faxLines (required). + /// warnings. + public FaxLineListResponse(ListInfoResponse listInfo = default(ListInfoResponse), List faxLines = default(List), WarningResponse warnings = default(WarningResponse)) + { + + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for FaxLineListResponse and cannot be null"); + } + this.ListInfo = listInfo; + // to ensure "faxLines" is required (not null) + if (faxLines == null) + { + throw new ArgumentNullException("faxLines is a required property for FaxLineListResponse and cannot be null"); + } + this.FaxLines = faxLines; + this.Warnings = warnings; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineListResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineListResponse"); + } + + return obj; + } + + /// + /// Gets or Sets ListInfo + /// + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] + public ListInfoResponse ListInfo { get; set; } + + /// + /// Gets or Sets FaxLines + /// + [DataMember(Name = "fax_lines", IsRequired = true, EmitDefaultValue = true)] + public List FaxLines { get; set; } + + /// + /// Gets or Sets Warnings + /// + [DataMember(Name = "warnings", EmitDefaultValue = true)] + public WarningResponse Warnings { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxLineListResponse {\n"); + sb.Append(" ListInfo: ").Append(ListInfo).Append("\n"); + sb.Append(" FaxLines: ").Append(FaxLines).Append("\n"); + sb.Append(" Warnings: ").Append(Warnings).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FaxLineListResponse); + } + + /// + /// Returns true if FaxLineListResponse instances are equal + /// + /// Instance of FaxLineListResponse to be compared + /// Boolean + public bool Equals(FaxLineListResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.ListInfo == input.ListInfo || + (this.ListInfo != null && + this.ListInfo.Equals(input.ListInfo)) + ) && + ( + this.FaxLines == input.FaxLines || + this.FaxLines != null && + input.FaxLines != null && + this.FaxLines.SequenceEqual(input.FaxLines) + ) && + ( + this.Warnings == input.Warnings || + (this.Warnings != null && + this.Warnings.Equals(input.Warnings)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ListInfo != null) + { + hashCode = (hashCode * 59) + this.ListInfo.GetHashCode(); + } + if (this.FaxLines != null) + { + hashCode = (hashCode * 59) + this.FaxLines.GetHashCode(); + } + if (this.Warnings != null) + { + hashCode = (hashCode * 59) + this.Warnings.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "list_info", + Property = "ListInfo", + Type = "ListInfoResponse", + Value = ListInfo, + }); + types.Add(new OpenApiType(){ + Name = "fax_lines", + Property = "FaxLines", + Type = "List", + Value = FaxLines, + }); + types.Add(new OpenApiType(){ + Name = "warnings", + Property = "Warnings", + Type = "WarningResponse", + Value = Warnings, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs b/src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs new file mode 100644 index 0000000..4a7b22f --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLineRemoveUserRequest.cs @@ -0,0 +1,221 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// FaxLineRemoveUserRequest + /// + [DataContract(Name = "FaxLineRemoveUserRequest")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineRemoveUserRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineRemoveUserRequest() { } + /// + /// Initializes a new instance of the class. + /// + /// The Fax Line number. (required). + /// Account ID. + /// Email address. + public FaxLineRemoveUserRequest(string number = default(string), string accountId = default(string), string emailAddress = default(string)) + { + + // to ensure "number" is required (not null) + if (number == null) + { + throw new ArgumentNullException("number is a required property for FaxLineRemoveUserRequest and cannot be null"); + } + this.Number = number; + this.AccountId = accountId; + this.EmailAddress = emailAddress; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineRemoveUserRequest Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineRemoveUserRequest"); + } + + return obj; + } + + /// + /// The Fax Line number. + /// + /// The Fax Line number. + [DataMember(Name = "number", IsRequired = true, EmitDefaultValue = true)] + public string Number { get; set; } + + /// + /// Account ID + /// + /// Account ID + /// ab55cd14a97219e36b5ff5fe23f2f9329b0c1e97 + [DataMember(Name = "account_id", EmitDefaultValue = true)] + public string AccountId { get; set; } + + /// + /// Email address + /// + /// Email address + [DataMember(Name = "email_address", EmitDefaultValue = true)] + public string EmailAddress { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxLineRemoveUserRequest {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" AccountId: ").Append(AccountId).Append("\n"); + sb.Append(" EmailAddress: ").Append(EmailAddress).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FaxLineRemoveUserRequest); + } + + /// + /// Returns true if FaxLineRemoveUserRequest instances are equal + /// + /// Instance of FaxLineRemoveUserRequest to be compared + /// Boolean + public bool Equals(FaxLineRemoveUserRequest input) + { + if (input == null) + { + return false; + } + return + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.AccountId == input.AccountId || + (this.AccountId != null && + this.AccountId.Equals(input.AccountId)) + ) && + ( + this.EmailAddress == input.EmailAddress || + (this.EmailAddress != null && + this.EmailAddress.Equals(input.EmailAddress)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + if (this.AccountId != null) + { + hashCode = (hashCode * 59) + this.AccountId.GetHashCode(); + } + if (this.EmailAddress != null) + { + hashCode = (hashCode * 59) + this.EmailAddress.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "number", + Property = "Number", + Type = "string", + Value = Number, + }); + types.Add(new OpenApiType(){ + Name = "account_id", + Property = "AccountId", + Type = "string", + Value = AccountId, + }); + types.Add(new OpenApiType(){ + Name = "email_address", + Property = "EmailAddress", + Type = "string", + Value = EmailAddress, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/FaxLineResponse.cs b/src/Dropbox.Sign/Model/FaxLineResponse.cs new file mode 100644 index 0000000..33442e7 --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLineResponse.cs @@ -0,0 +1,193 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// FaxLineResponse + /// + [DataContract(Name = "FaxLineResponse")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// faxLine (required). + /// warnings. + public FaxLineResponse(FaxLineResponseFaxLine faxLine = default(FaxLineResponseFaxLine), WarningResponse warnings = default(WarningResponse)) + { + + // to ensure "faxLine" is required (not null) + if (faxLine == null) + { + throw new ArgumentNullException("faxLine is a required property for FaxLineResponse and cannot be null"); + } + this.FaxLine = faxLine; + this.Warnings = warnings; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineResponse Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineResponse"); + } + + return obj; + } + + /// + /// Gets or Sets FaxLine + /// + [DataMember(Name = "fax_line", IsRequired = true, EmitDefaultValue = true)] + public FaxLineResponseFaxLine FaxLine { get; set; } + + /// + /// Gets or Sets Warnings + /// + [DataMember(Name = "warnings", EmitDefaultValue = true)] + public WarningResponse Warnings { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxLineResponse {\n"); + sb.Append(" FaxLine: ").Append(FaxLine).Append("\n"); + sb.Append(" Warnings: ").Append(Warnings).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FaxLineResponse); + } + + /// + /// Returns true if FaxLineResponse instances are equal + /// + /// Instance of FaxLineResponse to be compared + /// Boolean + public bool Equals(FaxLineResponse input) + { + if (input == null) + { + return false; + } + return + ( + this.FaxLine == input.FaxLine || + (this.FaxLine != null && + this.FaxLine.Equals(input.FaxLine)) + ) && + ( + this.Warnings == input.Warnings || + (this.Warnings != null && + this.Warnings.Equals(input.Warnings)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.FaxLine != null) + { + hashCode = (hashCode * 59) + this.FaxLine.GetHashCode(); + } + if (this.Warnings != null) + { + hashCode = (hashCode * 59) + this.Warnings.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "fax_line", + Property = "FaxLine", + Type = "FaxLineResponseFaxLine", + Value = FaxLine, + }); + types.Add(new OpenApiType(){ + Name = "warnings", + Property = "Warnings", + Type = "WarningResponse", + Value = Warnings, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/FaxLineResponseFaxLine.cs b/src/Dropbox.Sign/Model/FaxLineResponseFaxLine.cs new file mode 100644 index 0000000..a07bd24 --- /dev/null +++ b/src/Dropbox.Sign/Model/FaxLineResponseFaxLine.cs @@ -0,0 +1,232 @@ +/* + * Dropbox Sign API + * + * Dropbox Sign v3 API + * + * The version of the OpenAPI document: 3.0.0 + * Contact: apisupport@hellosign.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; + +namespace Dropbox.Sign.Model +{ + /// + /// FaxLineResponseFaxLine + /// + [DataContract(Name = "FaxLineResponseFaxLine")] + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] + public partial class FaxLineResponseFaxLine : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FaxLineResponseFaxLine() { } + /// + /// Initializes a new instance of the class. + /// + /// Number. + /// Created at. + /// Updated at. + /// accounts. + public FaxLineResponseFaxLine(string number = default(string), int createdAt = default(int), int updatedAt = default(int), List accounts = default(List)) + { + + this.Number = number; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + this.Accounts = accounts; + } + + /// + /// Attempt to instantiate and hydrate a new instance of this class + /// + /// String of JSON data representing target object + public static FaxLineResponseFaxLine Init(string jsonData) + { + var obj = JsonConvert.DeserializeObject(jsonData); + + if (obj == null) + { + throw new Exception("Unable to deserialize JSON to instance of FaxLineResponseFaxLine"); + } + + return obj; + } + + /// + /// Number + /// + /// Number + [DataMember(Name = "number", EmitDefaultValue = true)] + public string Number { get; set; } + + /// + /// Created at + /// + /// Created at + [DataMember(Name = "created_at", EmitDefaultValue = true)] + public int CreatedAt { get; set; } + + /// + /// Updated at + /// + /// Updated at + [DataMember(Name = "updated_at", EmitDefaultValue = true)] + public int UpdatedAt { get; set; } + + /// + /// Gets or Sets Accounts + /// + [DataMember(Name = "accounts", EmitDefaultValue = true)] + public List Accounts { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class FaxLineResponseFaxLine {\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n"); + sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n"); + sb.Append(" Accounts: ").Append(Accounts).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FaxLineResponseFaxLine); + } + + /// + /// Returns true if FaxLineResponseFaxLine instances are equal + /// + /// Instance of FaxLineResponseFaxLine to be compared + /// Boolean + public bool Equals(FaxLineResponseFaxLine input) + { + if (input == null) + { + return false; + } + return + ( + this.Number == input.Number || + (this.Number != null && + this.Number.Equals(input.Number)) + ) && + ( + this.CreatedAt == input.CreatedAt || + this.CreatedAt.Equals(input.CreatedAt) + ) && + ( + this.UpdatedAt == input.UpdatedAt || + this.UpdatedAt.Equals(input.UpdatedAt) + ) && + ( + this.Accounts == input.Accounts || + this.Accounts != null && + input.Accounts != null && + this.Accounts.SequenceEqual(input.Accounts) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Number != null) + { + hashCode = (hashCode * 59) + this.Number.GetHashCode(); + } + hashCode = (hashCode * 59) + this.CreatedAt.GetHashCode(); + hashCode = (hashCode * 59) + this.UpdatedAt.GetHashCode(); + if (this.Accounts != null) + { + hashCode = (hashCode * 59) + this.Accounts.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "number", + Property = "Number", + Type = "string", + Value = Number, + }); + types.Add(new OpenApiType(){ + Name = "created_at", + Property = "CreatedAt", + Type = "int", + Value = CreatedAt, + }); + types.Add(new OpenApiType(){ + Name = "updated_at", + Property = "UpdatedAt", + Type = "int", + Value = UpdatedAt, + }); + types.Add(new OpenApiType(){ + Name = "accounts", + Property = "Accounts", + Type = "List", + Value = Accounts, + }); + + return types; + } + } + +} diff --git a/src/Dropbox.Sign/Model/FileResponse.cs b/src/Dropbox.Sign/Model/FileResponse.cs index 751b8d9..fd5e27b 100644 --- a/src/Dropbox.Sign/Model/FileResponse.cs +++ b/src/Dropbox.Sign/Model/FileResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "FileResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class FileResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class FileResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected FileResponse() { } /// /// Initializes a new instance of the class. /// - /// URL to the file.. - /// When the link expires.. + /// URL to the file. (required). + /// When the link expires. (required). public FileResponse(string fileUrl = default(string), int expiresAt = default(int)) { + // to ensure "fileUrl" is required (not null) + if (fileUrl == null) + { + throw new ArgumentNullException("fileUrl is a required property for FileResponse and cannot be null"); + } this.FileUrl = fileUrl; this.ExpiresAt = expiresAt; } @@ -70,16 +75,16 @@ public static FileResponse Init(string jsonData) /// URL to the file. /// /// URL to the file. - [DataMember(Name = "file_url", EmitDefaultValue = true)] + [DataMember(Name = "file_url", IsRequired = true, EmitDefaultValue = true)] public string FileUrl { get; set; } - + /// /// When the link expires. /// /// When the link expires. - [DataMember(Name = "expires_at", EmitDefaultValue = true)] + [DataMember(Name = "expires_at", IsRequired = true, EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -154,6 +159,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -172,16 +186,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/FileResponseDataUri.cs b/src/Dropbox.Sign/Model/FileResponseDataUri.cs index e0ff3b8..bb84d48 100644 --- a/src/Dropbox.Sign/Model/FileResponseDataUri.cs +++ b/src/Dropbox.Sign/Model/FileResponseDataUri.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "FileResponseDataUri")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class FileResponseDataUri : IOpenApiTyped, IEquatable, IValidatableObject + public partial class FileResponseDataUri : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,10 +41,15 @@ protected FileResponseDataUri() { } /// /// Initializes a new instance of the class. /// - /// File as base64 encoded string.. + /// File as base64 encoded string. (required). public FileResponseDataUri(string dataUri = default(string)) { + // to ensure "dataUri" is required (not null) + if (dataUri == null) + { + throw new ArgumentNullException("dataUri is a required property for FileResponseDataUri and cannot be null"); + } this.DataUri = dataUri; } @@ -68,9 +73,9 @@ public static FileResponseDataUri Init(string jsonData) /// File as base64 encoded string. /// /// File as base64 encoded string. - [DataMember(Name = "data_uri", EmitDefaultValue = true)] + [DataMember(Name = "data_uri", IsRequired = true, EmitDefaultValue = true)] public string DataUri { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +144,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -151,16 +165,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ListInfoResponse.cs b/src/Dropbox.Sign/Model/ListInfoResponse.cs index 04a6d62..4788422 100644 --- a/src/Dropbox.Sign/Model/ListInfoResponse.cs +++ b/src/Dropbox.Sign/Model/ListInfoResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ListInfoResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ListInfoResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ListInfoResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,28 +76,28 @@ public static ListInfoResponse Init(string jsonData) /// Total number of pages available. [DataMember(Name = "num_pages", EmitDefaultValue = true)] public int NumPages { get; set; } - + /// /// Total number of objects available. /// /// Total number of objects available. [DataMember(Name = "num_results", EmitDefaultValue = true)] public int? NumResults { get; set; } - + /// /// Number of the page being returned. /// /// Number of the page being returned. [DataMember(Name = "page", EmitDefaultValue = true)] public int Page { get; set; } - + /// /// Objects returned per page. /// /// Objects returned per page. [DataMember(Name = "page_size", EmitDefaultValue = true)] public int PageSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -184,6 +184,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -214,16 +223,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/OAuthTokenGenerateRequest.cs b/src/Dropbox.Sign/Model/OAuthTokenGenerateRequest.cs index 28fae03..8410b28 100644 --- a/src/Dropbox.Sign/Model/OAuthTokenGenerateRequest.cs +++ b/src/Dropbox.Sign/Model/OAuthTokenGenerateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "OAuthTokenGenerateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class OAuthTokenGenerateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class OAuthTokenGenerateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -46,7 +46,7 @@ protected OAuthTokenGenerateRequest() { } /// The code passed to your callback when the user granted access. (required). /// When generating a new token use `authorization_code`. (required) (default to "authorization_code"). /// Same as the state you specified earlier. (required). - public OAuthTokenGenerateRequest(string clientId = default(string), string clientSecret = default(string), string code = default(string), string grantType = "authorization_code", string state = default(string)) + public OAuthTokenGenerateRequest(string clientId = default(string), string clientSecret = default(string), string code = default(string), string grantType = @"authorization_code", string state = default(string)) { // to ensure "clientId" is required (not null) @@ -103,35 +103,35 @@ public static OAuthTokenGenerateRequest Init(string jsonData) /// The client id of the app requesting authorization. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// The secret token of your app. /// /// The secret token of your app. [DataMember(Name = "client_secret", IsRequired = true, EmitDefaultValue = true)] public string ClientSecret { get; set; } - + /// /// The code passed to your callback when the user granted access. /// /// The code passed to your callback when the user granted access. [DataMember(Name = "code", IsRequired = true, EmitDefaultValue = true)] public string Code { get; set; } - + /// /// When generating a new token use `authorization_code`. /// /// When generating a new token use `authorization_code`. [DataMember(Name = "grant_type", IsRequired = true, EmitDefaultValue = true)] public string GrantType { get; set; } - + /// /// Same as the state you specified earlier. /// /// Same as the state you specified earlier. [DataMember(Name = "state", IsRequired = true, EmitDefaultValue = true)] public string State { get; set; } - + /// /// Returns the string presentation of the object /// @@ -240,6 +240,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -276,16 +285,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/OAuthTokenRefreshRequest.cs b/src/Dropbox.Sign/Model/OAuthTokenRefreshRequest.cs index 335fed3..3f85000 100644 --- a/src/Dropbox.Sign/Model/OAuthTokenRefreshRequest.cs +++ b/src/Dropbox.Sign/Model/OAuthTokenRefreshRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "OAuthTokenRefreshRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class OAuthTokenRefreshRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class OAuthTokenRefreshRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -43,7 +43,7 @@ protected OAuthTokenRefreshRequest() { } /// /// When refreshing an existing token use `refresh_token`. (required) (default to "refresh_token"). /// The token provided when you got the expired access token. (required). - public OAuthTokenRefreshRequest(string grantType = "refresh_token", string refreshToken = default(string)) + public OAuthTokenRefreshRequest(string grantType = @"refresh_token", string refreshToken = default(string)) { // to ensure "grantType" is required (not null) @@ -82,14 +82,14 @@ public static OAuthTokenRefreshRequest Init(string jsonData) /// When refreshing an existing token use `refresh_token`. [DataMember(Name = "grant_type", IsRequired = true, EmitDefaultValue = true)] public string GrantType { get; set; } - + /// /// The token provided when you got the expired access token. /// /// The token provided when you got the expired access token. [DataMember(Name = "refresh_token", IsRequired = true, EmitDefaultValue = true)] public string RefreshToken { get; set; } - + /// /// Returns the string presentation of the object /// @@ -168,6 +168,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -186,16 +195,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/OAuthTokenResponse.cs b/src/Dropbox.Sign/Model/OAuthTokenResponse.cs index b61ca1d..fe8b724 100644 --- a/src/Dropbox.Sign/Model/OAuthTokenResponse.cs +++ b/src/Dropbox.Sign/Model/OAuthTokenResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "OAuthTokenResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class OAuthTokenResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class OAuthTokenResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -77,32 +77,32 @@ public static OAuthTokenResponse Init(string jsonData) /// [DataMember(Name = "access_token", EmitDefaultValue = true)] public string AccessToken { get; set; } - + /// /// Gets or Sets TokenType /// [DataMember(Name = "token_type", EmitDefaultValue = true)] public string TokenType { get; set; } - + /// /// Gets or Sets RefreshToken /// [DataMember(Name = "refresh_token", EmitDefaultValue = true)] public string RefreshToken { get; set; } - + /// /// Number of seconds until the `access_token` expires. Uses epoch time. /// /// Number of seconds until the `access_token` expires. Uses epoch time. [DataMember(Name = "expires_in", EmitDefaultValue = true)] public int ExpiresIn { get; set; } - + /// /// Gets or Sets State /// [DataMember(Name = "state", EmitDefaultValue = true)] public string State { get; set; } - + /// /// Returns the string presentation of the object /// @@ -207,6 +207,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -243,16 +252,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ReportCreateRequest.cs b/src/Dropbox.Sign/Model/ReportCreateRequest.cs index 7792949..381e9dc 100644 --- a/src/Dropbox.Sign/Model/ReportCreateRequest.cs +++ b/src/Dropbox.Sign/Model/ReportCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ReportCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ReportCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ReportCreateRequest : IEquatable, IValidatableObject { /// /// Defines ReportType @@ -50,17 +50,8 @@ public enum ReportTypeEnum /// [EnumMember(Value = "document_status")] DocumentStatus = 2 - } - - - /// - /// 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). - /// - /// 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). - [DataMember(Name = "report_type", IsRequired = true, EmitDefaultValue = true)] - public List ReportType { get; set; } /// /// Initializes a new instance of the class. /// @@ -117,14 +108,21 @@ public static ReportCreateRequest Init(string jsonData) /// The (inclusive) end date for the report data in `MM/DD/YYYY` format. [DataMember(Name = "end_date", IsRequired = true, EmitDefaultValue = true)] public string EndDate { get; set; } - + + /// + /// 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). + /// + /// 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). + [DataMember(Name = "report_type", IsRequired = true, EmitDefaultValue = true)] + public List ReportType { get; set; } + /// /// The (inclusive) start date for the report data in `MM/DD/YYYY` format. /// /// The (inclusive) start date for the report data in `MM/DD/YYYY` format. [DataMember(Name = "start_date", IsRequired = true, EmitDefaultValue = true)] public string StartDate { get; set; } - + /// /// Returns the string presentation of the object /// @@ -178,6 +176,8 @@ public bool Equals(ReportCreateRequest input) ) && ( this.ReportType == input.ReportType || + this.ReportType != null && + input.ReportType != null && this.ReportType.SequenceEqual(input.ReportType) ) && ( @@ -200,7 +200,10 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.EndDate.GetHashCode(); } - hashCode = (hashCode * 59) + this.ReportType.GetHashCode(); + if (this.ReportType != null) + { + hashCode = (hashCode * 59) + this.ReportType.GetHashCode(); + } if (this.StartDate != null) { hashCode = (hashCode * 59) + this.StartDate.GetHashCode(); @@ -209,6 +212,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -221,7 +233,7 @@ public List GetOpenApiTypes() types.Add(new OpenApiType(){ Name = "report_type", Property = "ReportType", - Type = "List", + Type = "List", Value = ReportType, }); types.Add(new OpenApiType(){ @@ -233,16 +245,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ReportCreateResponse.cs b/src/Dropbox.Sign/Model/ReportCreateResponse.cs index 30d81f9..4ea4c3d 100644 --- a/src/Dropbox.Sign/Model/ReportCreateResponse.cs +++ b/src/Dropbox.Sign/Model/ReportCreateResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ReportCreateResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ReportCreateResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ReportCreateResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected ReportCreateResponse() { } /// /// Initializes a new instance of the class. /// - /// report. + /// report (required). /// A list of warnings.. public ReportCreateResponse(ReportResponse report = default(ReportResponse), List warnings = default(List)) { + // to ensure "report" is required (not null) + if (report == null) + { + throw new ArgumentNullException("report is a required property for ReportCreateResponse and cannot be null"); + } this.Report = report; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static ReportCreateResponse Init(string jsonData) /// /// Gets or Sets Report /// - [DataMember(Name = "report", EmitDefaultValue = true)] + [DataMember(Name = "report", IsRequired = true, EmitDefaultValue = true)] public ReportResponse Report { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/ReportResponse.cs b/src/Dropbox.Sign/Model/ReportResponse.cs index 367e6f8..172243e 100644 --- a/src/Dropbox.Sign/Model/ReportResponse.cs +++ b/src/Dropbox.Sign/Model/ReportResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "ReportResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class ReportResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class ReportResponse : IEquatable, IValidatableObject { /// /// Defines ReportType @@ -50,17 +50,8 @@ public enum ReportTypeEnum /// [EnumMember(Value = "document_status")] DocumentStatus = 2 - } - - - /// - /// 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). - /// - /// 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). - [DataMember(Name = "report_type", EmitDefaultValue = true)] - public List ReportType { get; set; } /// /// Initializes a new instance of the class. /// @@ -104,21 +95,28 @@ public static ReportResponse Init(string jsonData) /// A message indicating the requested operation's success [DataMember(Name = "success", EmitDefaultValue = true)] public string Success { get; set; } - + /// /// The (inclusive) start date for the report data in MM/DD/YYYY format. /// /// The (inclusive) start date for the report data in MM/DD/YYYY format. [DataMember(Name = "start_date", EmitDefaultValue = true)] public string StartDate { get; set; } - + /// /// The (inclusive) end date for the report data in MM/DD/YYYY format. /// /// The (inclusive) end date for the report data in MM/DD/YYYY format. [DataMember(Name = "end_date", EmitDefaultValue = true)] public string EndDate { get; set; } - + + /// + /// 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). + /// + /// 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). + [DataMember(Name = "report_type", EmitDefaultValue = true)] + public List ReportType { get; set; } + /// /// Returns the string presentation of the object /// @@ -183,6 +181,8 @@ public bool Equals(ReportResponse input) ) && ( this.ReportType == input.ReportType || + this.ReportType != null && + input.ReportType != null && this.ReportType.SequenceEqual(input.ReportType) ); } @@ -208,11 +208,23 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.EndDate.GetHashCode(); } - hashCode = (hashCode * 59) + this.ReportType.GetHashCode(); + if (this.ReportType != null) + { + hashCode = (hashCode * 59) + this.ReportType.GetHashCode(); + } return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -237,22 +249,12 @@ public List GetOpenApiTypes() types.Add(new OpenApiType(){ Name = "report_type", Property = "ReportType", - Type = "List", + Type = "List", Value = ReportType, }); return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs index 2586c65..e5f910c 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestBulkCreateEmbeddedWithTemplateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestBulkCreateEmbeddedWithTemplateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestBulkCreateEmbeddedWithTemplateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestBulkCreateEmbeddedWithTemplateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -104,91 +104,91 @@ public static SignatureRequestBulkCreateEmbeddedWithTemplateRequest Init(string /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// Client id of the app you're using to create this embedded signature request. Used for security purposes. /// /// Client id of the app you're using to create this embedded signature request. Used for security purposes. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// `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_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 ``` [DataMember(Name = "signer_file", EmitDefaultValue = true)] public System.IO.Stream SignerFile { get; set; } - + /// /// `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_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. [DataMember(Name = "signer_list", EmitDefaultValue = true)] public List SignerList { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Add CC email recipients. Required when a CC role exists for the Template. /// /// Add CC email recipients. Required when a CC role exists for the Template. [DataMember(Name = "ccs", EmitDefaultValue = true)] public List Ccs { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Returns the string presentation of the object /// @@ -374,6 +374,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -458,34 +485,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs index c2356a8..81b747a 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestBulkSendWithTemplateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestBulkSendWithTemplateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestBulkSendWithTemplateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestBulkSendWithTemplateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -99,91 +99,91 @@ public static SignatureRequestBulkSendWithTemplateRequest Init(string jsonData) /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// `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_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 ``` [DataMember(Name = "signer_file", EmitDefaultValue = true)] public System.IO.Stream SignerFile { get; set; } - + /// /// `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_list` is an array defining values and options for signer fields. Required unless a `signer_file` is used, you may not use both. [DataMember(Name = "signer_list", EmitDefaultValue = true)] public List SignerList { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Add CC email recipients. Required when a CC role exists for the Template. /// /// Add CC email recipients. Required when a CC role exists for the Template. [DataMember(Name = "ccs", EmitDefaultValue = true)] public List Ccs { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Returns the string presentation of the object /// @@ -369,6 +369,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -453,34 +480,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedRequest.cs index d2133fe..be87871 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedRequest.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestCreateEmbeddedRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestCreateEmbeddedRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestCreateEmbeddedRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -121,166 +121,166 @@ public static SignatureRequestCreateEmbeddedRequest Init(string jsonData) /// Client id of the app you're using to create this embedded signature request. Used for security purposes. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. /// /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. /// /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. [DataMember(Name = "grouped_signers", EmitDefaultValue = true)] public List GroupedSigners { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. /// /// Allows signers to reassign their signature requests to other signers if set to `true`. Defaults to `false`. **NOTE:** Only available for Premium plan. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The email addresses that should be CCed. /// /// The email addresses that should be CCed. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// 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` /// /// 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` [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] public bool HideTextTags { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] public bool UseTextTags { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] public bool PopulateAutoFillFields { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -566,6 +566,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -716,34 +743,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs index 434dff6..af8b50e 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestCreateEmbeddedWithTemplateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestCreateEmbeddedWithTemplateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestCreateEmbeddedWithTemplateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestCreateEmbeddedWithTemplateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -113,104 +113,104 @@ public static SignatureRequestCreateEmbeddedWithTemplateRequest Init(string json /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// Client id of the app you're using to create this embedded signature request. Used for security purposes. /// /// Client id of the app you're using to create this embedded signature request. Used for security purposes. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Add Signers to your Templated-based Signature Request. /// /// Add Signers to your Templated-based Signature Request. [DataMember(Name = "signers", IsRequired = true, EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Add CC email recipients. Required when a CC role exists for the Template. /// /// Add CC email recipients. Required when a CC role exists for the Template. [DataMember(Name = "ccs", EmitDefaultValue = true)] public List Ccs { get; set; } - + /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] public bool PopulateAutoFillFields { get; set; } - + /// /// Returns the string presentation of the object /// @@ -414,6 +414,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -510,34 +537,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestGetResponse.cs b/src/Dropbox.Sign/Model/SignatureRequestGetResponse.cs index 99c5ca2..fb7c89e 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestGetResponse.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected SignatureRequestGetResponse() { } /// /// Initializes a new instance of the class. /// - /// signatureRequest. + /// signatureRequest (required). /// A list of warnings.. public SignatureRequestGetResponse(SignatureRequestResponse signatureRequest = default(SignatureRequestResponse), List warnings = default(List)) { + // to ensure "signatureRequest" is required (not null) + if (signatureRequest == null) + { + throw new ArgumentNullException("signatureRequest is a required property for SignatureRequestGetResponse and cannot be null"); + } this.SignatureRequest = signatureRequest; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static SignatureRequestGetResponse Init(string jsonData) /// /// Gets or Sets SignatureRequest /// - [DataMember(Name = "signature_request", EmitDefaultValue = true)] + [DataMember(Name = "signature_request", IsRequired = true, EmitDefaultValue = true)] public SignatureRequestResponse SignatureRequest { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestListResponse.cs b/src/Dropbox.Sign/Model/SignatureRequestListResponse.cs index 6ee599b..c930e02 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestListResponse.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestListResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestListResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestListResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestListResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected SignatureRequestListResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains information about signature requests.. - /// listInfo. + /// Contains information about signature requests. (required). + /// listInfo (required). /// A list of warnings.. public SignatureRequestListResponse(List signatureRequests = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "signatureRequests" is required (not null) + if (signatureRequests == null) + { + throw new ArgumentNullException("signatureRequests is a required property for SignatureRequestListResponse and cannot be null"); + } this.SignatureRequests = signatureRequests; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for SignatureRequestListResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,22 +82,22 @@ public static SignatureRequestListResponse Init(string jsonData) /// Contains information about signature requests. /// /// Contains information about signature requests. - [DataMember(Name = "signature_requests", EmitDefaultValue = true)] + [DataMember(Name = "signature_requests", IsRequired = true, EmitDefaultValue = true)] public List SignatureRequests { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -178,6 +188,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -202,16 +221,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestRemindRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestRemindRequest.cs index d014fd0..186a374 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestRemindRequest.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestRemindRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestRemindRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestRemindRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestRemindRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -77,14 +77,14 @@ public static SignatureRequestRemindRequest Init(string jsonData) /// The email address of the signer to send a reminder to. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The name of the signer to send a reminder to. Include if two or more signers share an email address. /// /// The name of the signer to send a reminder to. Include if two or more signers share an email address. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -163,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -181,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponse.cs b/src/Dropbox.Sign/Model/SignatureRequestResponse.cs index b2663d8..4b06dc8 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponse.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -119,175 +119,175 @@ public static SignatureRequestResponse Init(string jsonData) /// Whether this is a test signature request. Test requests have no legal value. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool? TestMode { get; set; } - + /// /// The id of the SignatureRequest. /// /// The id of the SignatureRequest. [DataMember(Name = "signature_request_id", EmitDefaultValue = true)] public string SignatureRequestId { get; set; } - + /// /// The email address of the initiator of the SignatureRequest. /// /// The email address of the initiator of the SignatureRequest. [DataMember(Name = "requester_email_address", EmitDefaultValue = true)] public string RequesterEmailAddress { get; set; } - + /// /// The title the specified Account uses for the SignatureRequest. /// /// The title the specified Account uses for the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Default Label for account. /// /// Default Label for account. [DataMember(Name = "original_title", EmitDefaultValue = true)] public string OriginalTitle { get; set; } - + /// /// The subject in the email that was initially sent to the signers. /// /// The subject in the email that was initially sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// The custom message in the email that was initially sent to the signers. /// /// The custom message in the email that was initially sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// The metadata attached to the signature request. /// /// The metadata attached to the signature request. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Object Metadata { get; set; } - + /// /// Time the signature request was created. /// /// Time the signature request was created. [DataMember(Name = "created_at", EmitDefaultValue = true)] public int CreatedAt { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Whether or not the SignatureRequest has been fully executed by all signers. /// /// Whether or not the SignatureRequest has been fully executed by all signers. [DataMember(Name = "is_complete", EmitDefaultValue = true)] public bool IsComplete { get; set; } - + /// /// Whether or not the SignatureRequest has been declined by a signer. /// /// Whether or not the SignatureRequest has been declined by a signer. [DataMember(Name = "is_declined", EmitDefaultValue = true)] public bool IsDeclined { get; set; } - + /// /// Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). /// /// Whether or not an error occurred (either during the creation of the SignatureRequest or during one of the signings). [DataMember(Name = "has_error", EmitDefaultValue = true)] public bool HasError { get; set; } - + /// /// The URL where a copy of the request's documents can be downloaded. /// /// The URL where a copy of the request's documents can be downloaded. [DataMember(Name = "files_url", EmitDefaultValue = true)] public string FilesUrl { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "signing_url", EmitDefaultValue = true)] public string SigningUrl { get; set; } - + /// /// The URL where the requester and the signers can view the current status of the SignatureRequest. /// /// The URL where the requester and the signers can view the current status of the SignatureRequest. [DataMember(Name = "details_url", EmitDefaultValue = true)] public string DetailsUrl { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// The URL you want the signer redirected to after they successfully sign. /// /// The URL you want the signer redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The path where the completed document can be downloaded /// /// The path where the completed document can be downloaded [DataMember(Name = "final_copy_uri", EmitDefaultValue = true)] public string FinalCopyUri { get; set; } - + /// /// Templates IDs used in this SignatureRequest (if any). /// /// Templates IDs used in this SignatureRequest (if any). [DataMember(Name = "template_ids", EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` /// /// An array of Custom Field objects containing the name and type of each custom field. * Text Field uses `SignatureRequestResponseCustomFieldText` * Checkbox Field uses `SignatureRequestResponseCustomFieldCheckbox` [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Signer attachments. /// /// Signer attachments. [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. /// /// An array of form field objects containing the name, value, and type of each textbox or checkmark field filled in by the signers. [DataMember(Name = "response_data", EmitDefaultValue = true)] public List ResponseData { get; set; } - + /// /// An array of signature objects, 1 for each signer. /// /// An array of signature objects, 1 for each signer. [DataMember(Name = "signatures", EmitDefaultValue = true)] public List Signatures { get; set; } - + /// /// The ID of the Bulk Send job which sent the signature request, if applicable. /// /// The ID of the Bulk Send job which sent the signature request, if applicable. [DataMember(Name = "bulk_send_job_id", EmitDefaultValue = true)] public string BulkSendJobId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -582,6 +582,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -738,16 +747,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseAttachment.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseAttachment.cs index 4ef4e58..9444496 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseAttachment.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseAttachment.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestResponseAttachment")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestResponseAttachment : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestResponseAttachment : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -47,7 +47,7 @@ protected SignatureRequestResponseAttachment() { } /// A boolean value denoting if this attachment is required. (required). /// Instructions for Signer.. /// Timestamp when attachment was uploaded by Signer.. - public SignatureRequestResponseAttachment(string id = default(string), string signer = default(string), string name = default(string), bool required = default(bool), string instructions = default(string), int? uploadedAt = default(int?)) + public SignatureRequestResponseAttachment(string id = default(string), Object signer = null, string name = default(string), bool required = default(bool), string instructions = default(string), int? uploadedAt = default(int?)) { // to ensure "id" is required (not null) @@ -61,7 +61,7 @@ protected SignatureRequestResponseAttachment() { } { throw new ArgumentNullException("signer is a required property for SignatureRequestResponseAttachment and cannot be null"); } - this.Signer = signer; + this.Signer = Convert.ToString(signer); // to ensure "name" is required (not null) if (name == null) { @@ -95,42 +95,46 @@ public static SignatureRequestResponseAttachment Init(string jsonData) /// The unique ID for this attachment. [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] public string Id { get; set; } - + /// /// The Signer this attachment is assigned to. /// /// The Signer this attachment is assigned to. [DataMember(Name = "signer", IsRequired = true, EmitDefaultValue = true)] - public string Signer { get; set; } + public object Signer { + get => this._signer; + set => this._signer = Convert.ToString(value); + } + private string _signer; /// /// The name of this attachment. /// /// The name of this attachment. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// A boolean value denoting if this attachment is required. /// /// A boolean value denoting if this attachment is required. [DataMember(Name = "required", IsRequired = true, EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// Instructions for Signer. /// /// Instructions for Signer. [DataMember(Name = "instructions", EmitDefaultValue = true)] public string Instructions { get; set; } - + /// /// Timestamp when attachment was uploaded by Signer. /// /// Timestamp when attachment was uploaded by Signer. [DataMember(Name = "uploaded_at", EmitDefaultValue = true)] public int? UploadedAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -245,6 +249,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -287,16 +300,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldBase.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldBase.cs index 80892f4..817d977 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldBase.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldBase.cs @@ -32,12 +32,10 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestResponseCustomFieldBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldCheckbox), "SignatureRequestResponseCustomFieldCheckbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldText), "SignatureRequestResponseCustomFieldText")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestResponseCustomFieldBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestResponseCustomFieldBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -94,35 +92,35 @@ public static SignatureRequestResponseCustomFieldBase Init(string jsonData) /// The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The name of the Custom Field. /// /// The name of the Custom Field. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// A boolean value denoting if this field is required. /// /// A boolean value denoting if this field is required. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// The unique ID for this field. /// /// The unique ID for this field. [DataMember(Name = "api_id", EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// The name of the Role that is able to edit this field. /// /// The name of the Role that is able to edit this field. [DataMember(Name = "editor", EmitDefaultValue = true)] public string Editor { get; set; } - + /// /// Returns the string presentation of the object /// @@ -227,6 +225,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -263,26 +280,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldCheckbox.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldCheckbox.cs index 6423af7..719ce06 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldCheckbox.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,9 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SignatureRequestResponseCustomFieldBase`. /// [DataContract(Name = "SignatureRequestResponseCustomFieldCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseCustomFieldCheckbox : SignatureRequestResponseCustomFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -51,7 +47,7 @@ protected SignatureRequestResponseCustomFieldCheckbox() { } /// A boolean value denoting if this field is required.. /// The unique ID for this field.. /// The name of the Role that is able to edit this field.. - public SignatureRequestResponseCustomFieldCheckbox(string type = "checkbox", bool value = default(bool), string name = default(string), bool required = default(bool), string apiId = default(string), string editor = default(string)) + public SignatureRequestResponseCustomFieldCheckbox(string type = @"checkbox", bool value = default(bool), string name = default(string), bool required = default(bool), string apiId = default(string), string editor = default(string)) { this.Name = name; this.Required = required; @@ -89,14 +85,14 @@ public static SignatureRequestResponseCustomFieldCheckbox Init(string jsonData) /// The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// A true/false for checkbox fields /// /// A true/false for checkbox fields [DataMember(Name = "value", EmitDefaultValue = true)] public bool Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -172,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "bool", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -206,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -214,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "bool", + Value = Value, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldText.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldText.cs index 2ad1fc7..aea87dd 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldText.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,9 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SignatureRequestResponseCustomFieldBase`. /// [DataContract(Name = "SignatureRequestResponseCustomFieldText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseCustomFieldText : SignatureRequestResponseCustomFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -51,7 +47,7 @@ protected SignatureRequestResponseCustomFieldText() { } /// A boolean value denoting if this field is required.. /// The unique ID for this field.. /// The name of the Role that is able to edit this field.. - public SignatureRequestResponseCustomFieldText(string type = "text", string value = default(string), string name = default(string), bool required = default(bool), string apiId = default(string), string editor = default(string)) + public SignatureRequestResponseCustomFieldText(string type = @"text", string value = default(string), string name = default(string), bool required = default(bool), string apiId = default(string), string editor = default(string)) { this.Name = name; this.Required = required; @@ -89,14 +85,14 @@ public static SignatureRequestResponseCustomFieldText Init(string jsonData) /// The type of this Custom Field. Only 'text' and 'checkbox' are currently supported. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// A text string for text fields /// /// A text string for text fields [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -176,31 +172,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -210,7 +187,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -218,6 +195,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldTypeEnum.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldTypeEnum.cs index f1de798..fc25c94 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldTypeEnum.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseCustomFieldTypeEnum.cs @@ -43,7 +43,6 @@ public enum SignatureRequestResponseCustomFieldTypeEnum /// [EnumMember(Value = "checkbox")] Checkbox = 2 - } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseDataBase.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseDataBase.cs index 3868f56..42d2946 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseDataBase.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseDataBase.cs @@ -32,15 +32,6 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestResponseDataBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "SignatureRequestResponseDataValueCheckbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "SignatureRequestResponseDataValueCheckboxMerge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "SignatureRequestResponseDataValueDateSigned")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "SignatureRequestResponseDataValueDropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "SignatureRequestResponseDataValueInitials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "SignatureRequestResponseDataValueRadio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "SignatureRequestResponseDataValueSignature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "SignatureRequestResponseDataValueText")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "SignatureRequestResponseDataValueTextMerge")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] @@ -51,7 +42,7 @@ namespace Dropbox.Sign.Model [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestResponseDataBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestResponseDataBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -98,34 +89,34 @@ public static SignatureRequestResponseDataBase Init(string jsonData) /// The unique ID for this field. [DataMember(Name = "api_id", EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// The ID of the signature to which this response is linked. /// /// The ID of the signature to which this response is linked. [DataMember(Name = "signature_id", EmitDefaultValue = true)] public string SignatureId { get; set; } - + /// /// The name of the form field. /// /// The name of the form field. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// A boolean value denoting if this field is required. /// /// A boolean value denoting if this field is required. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// Gets or Sets Type /// [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -230,6 +221,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -266,26 +276,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseDataTypeEnum.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseDataTypeEnum.cs index a2ddda7..25f0454 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseDataTypeEnum.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseDataTypeEnum.cs @@ -85,7 +85,6 @@ public enum SignatureRequestResponseDataTypeEnum /// [EnumMember(Value = "checkbox-merge")] CheckboxMerge = 9 - } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckbox.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckbox.cs index 980cef3..25ae1ff 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckbox.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueCheckbox /// [DataContract(Name = "SignatureRequestResponseDataValueCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueCheckbox : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueCheckbox() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueCheckbox(string type = "checkbox", bool value = default(bool), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueCheckbox(string type = @"checkbox", bool value = default(bool), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueCheckbox Init(string jsonData) /// A yes/no checkbox [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public bool Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -175,31 +164,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "bool", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -209,7 +179,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -217,6 +187,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "bool", + Value = Value, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckboxMerge.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckboxMerge.cs index 3638e45..093bf26 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckboxMerge.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueCheckboxMerge.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueCheckboxMerge /// [DataContract(Name = "SignatureRequestResponseDataValueCheckboxMerge")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueCheckboxMerge : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueCheckboxMerge() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueCheckboxMerge(string type = "checkbox-merge", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueCheckboxMerge(string type = @"checkbox-merge", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueCheckboxMerge Init(string jsonDat /// A checkbox field that has default value set by the api [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDateSigned.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDateSigned.cs index 4fa9033..f5f43e0 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDateSigned.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDateSigned.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueDateSigned /// [DataContract(Name = "SignatureRequestResponseDataValueDateSigned")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueDateSigned : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueDateSigned() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueDateSigned(string type = "date_signed", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueDateSigned(string type = @"date_signed", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueDateSigned Init(string jsonData) /// A date [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDropdown.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDropdown.cs index fffeec0..f7be6cb 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDropdown.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueDropdown.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueDropdown /// [DataContract(Name = "SignatureRequestResponseDataValueDropdown")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueDropdown : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueDropdown() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueDropdown(string type = "dropdown", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueDropdown(string type = @"dropdown", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueDropdown Init(string jsonData) /// An input field for dropdowns [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueInitials.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueInitials.cs index 36ee66b..dda612c 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueInitials.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueInitials.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueInitials /// [DataContract(Name = "SignatureRequestResponseDataValueInitials")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueInitials : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueInitials() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueInitials(string type = "initials", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueInitials(string type = @"initials", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueInitials Init(string jsonData) /// An input field for initials [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueRadio.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueRadio.cs index a147981..9533351 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueRadio.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueRadio.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueRadio /// [DataContract(Name = "SignatureRequestResponseDataValueRadio")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueRadio : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueRadio() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueRadio(string type = "radio", bool value = default(bool), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueRadio(string type = @"radio", bool value = default(bool), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueRadio Init(string jsonData) /// An input field for radios [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public bool Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -175,31 +164,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "bool", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -209,7 +179,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -217,6 +187,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "bool", + Value = Value, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueSignature.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueSignature.cs index 54308ca..828a871 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueSignature.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueSignature.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueSignature /// [DataContract(Name = "SignatureRequestResponseDataValueSignature")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueSignature : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueSignature() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueSignature(string type = "signature", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueSignature(string type = @"signature", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueSignature Init(string jsonData) /// A signature input field [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueText.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueText.cs index 0db497c..2355796 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueText.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueText /// [DataContract(Name = "SignatureRequestResponseDataValueText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueText : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueText() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueText(string type = "text", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueText(string type = @"text", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueText Init(string jsonData) /// A text input field [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueTextMerge.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueTextMerge.cs index 764ffd1..9bc4543 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueTextMerge.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseDataValueTextMerge.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,16 +30,6 @@ namespace Dropbox.Sign.Model /// SignatureRequestResponseDataValueTextMerge /// [DataContract(Name = "SignatureRequestResponseDataValueTextMerge")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueText), "text")] - [JsonSubtypes.KnownSubType(typeof(SignatureRequestResponseDataValueTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SignatureRequestResponseDataValueTextMerge : SignatureRequestResponseDataBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -58,7 +47,7 @@ protected SignatureRequestResponseDataValueTextMerge() { } /// The ID of the signature to which this response is linked.. /// The name of the form field.. /// A boolean value denoting if this field is required.. - public SignatureRequestResponseDataValueTextMerge(string type = "text-merge", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) + public SignatureRequestResponseDataValueTextMerge(string type = @"text-merge", string value = default(string), string apiId = default(string), string signatureId = default(string), string name = default(string), bool required = default(bool)) { this.ApiId = apiId; this.SignatureId = signatureId; @@ -92,14 +81,14 @@ public static SignatureRequestResponseDataValueTextMerge Init(string jsonData) /// A text field that has default text set by the api [DataMember(Name = "type", EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The value of the form field. /// /// The value of the form field. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -179,31 +168,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - types.Add(new OpenApiType(){ - Name = "value", - Property = "Value", - Type = "string", - Value = Value, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -213,7 +183,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -221,6 +191,24 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + types.Add(new OpenApiType(){ + Name = "value", + Property = "Value", + Type = "string", + Value = Value, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestResponseSignatures.cs b/src/Dropbox.Sign/Model/SignatureRequestResponseSignatures.cs index 46ed7f3..5b1e3d6 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestResponseSignatures.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestResponseSignatures.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestResponseSignatures")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestResponseSignatures : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestResponseSignatures : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -106,133 +106,133 @@ public static SignatureRequestResponseSignatures Init(string jsonData) /// Signature identifier. [DataMember(Name = "signature_id", EmitDefaultValue = true)] public string SignatureId { get; set; } - + /// /// Signer Group GUID /// /// Signer Group GUID [DataMember(Name = "signer_group_guid", EmitDefaultValue = true)] public string SignerGroupGuid { get; set; } - + /// /// The email address of the signer. /// /// The email address of the signer. [DataMember(Name = "signer_email_address", EmitDefaultValue = true)] public string SignerEmailAddress { get; set; } - + /// /// The name of the signer. /// /// The name of the signer. [DataMember(Name = "signer_name", EmitDefaultValue = true)] public string SignerName { get; set; } - + /// /// The role of the signer. /// /// The role of the signer. [DataMember(Name = "signer_role", EmitDefaultValue = true)] public string SignerRole { get; set; } - + /// /// If signer order is assigned this is the 0-based index for this signer. /// /// If signer order is assigned this is the 0-based index for this signer. [DataMember(Name = "order", EmitDefaultValue = true)] public int? Order { get; set; } - + /// /// The current status of the signature. eg: awaiting_signature, signed, declined. /// /// The current status of the signature. eg: awaiting_signature, signed, declined. [DataMember(Name = "status_code", EmitDefaultValue = true)] public string StatusCode { get; set; } - + /// /// The reason provided by the signer for declining the request. /// /// The reason provided by the signer for declining the request. [DataMember(Name = "decline_reason", EmitDefaultValue = true)] public string DeclineReason { get; set; } - + /// /// Time that the document was signed or null. /// /// Time that the document was signed or null. [DataMember(Name = "signed_at", EmitDefaultValue = true)] public int? SignedAt { get; set; } - + /// /// The time that the document was last viewed by this signer or null. /// /// The time that the document was last viewed by this signer or null. [DataMember(Name = "last_viewed_at", EmitDefaultValue = true)] public int? LastViewedAt { get; set; } - + /// /// The time the last reminder email was sent to the signer or null. /// /// The time the last reminder email was sent to the signer or null. [DataMember(Name = "last_reminded_at", EmitDefaultValue = true)] public int? LastRemindedAt { get; set; } - + /// /// Boolean to indicate whether this signature requires a PIN to access. /// /// Boolean to indicate whether this signature requires a PIN to access. [DataMember(Name = "has_pin", EmitDefaultValue = true)] public bool HasPin { get; set; } - + /// /// Boolean to indicate whether this signature has SMS authentication enabled. /// /// Boolean to indicate whether this signature has SMS authentication enabled. [DataMember(Name = "has_sms_auth", EmitDefaultValue = true)] public bool? HasSmsAuth { get; set; } - + /// /// Boolean to indicate whether this signature has SMS delivery enabled. /// /// Boolean to indicate whether this signature has SMS delivery enabled. [DataMember(Name = "has_sms_delivery", EmitDefaultValue = true)] public bool? HasSmsDelivery { get; set; } - + /// /// The SMS phone number used for authentication or signature request delivery. /// /// The SMS phone number used for authentication or signature request delivery. [DataMember(Name = "sms_phone_number", EmitDefaultValue = true)] public string SmsPhoneNumber { get; set; } - + /// /// Email address of original signer who reassigned to this signer. /// /// Email address of original signer who reassigned to this signer. [DataMember(Name = "reassigned_by", EmitDefaultValue = true)] public string ReassignedBy { get; set; } - + /// /// Reason provided by original signer who reassigned to this signer. /// /// Reason provided by original signer who reassigned to this signer. [DataMember(Name = "reassignment_reason", EmitDefaultValue = true)] public string ReassignmentReason { get; set; } - + /// /// Previous signature identifier. /// /// Previous signature identifier. [DataMember(Name = "reassigned_from", EmitDefaultValue = true)] public string ReassignedFrom { get; set; } - + /// /// Error message pertaining to this signer, or null. /// /// Error message pertaining to this signer, or null. [DataMember(Name = "error", EmitDefaultValue = true)] public string Error { get; set; } - + /// /// Returns the string presentation of the object /// @@ -477,6 +477,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -597,16 +606,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestSendRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestSendRequest.cs index b8c13f7..56e90b0 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestSendRequest.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestSendRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestSendRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestSendRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestSendRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -120,104 +120,104 @@ public static SignatureRequestSendRequest Init(string jsonData) /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. /// /// Add Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. /// /// Add Grouped Signers to your Signature Request. This endpoint requires either **signers** or **grouped_signers**, but not both. [DataMember(Name = "grouped_signers", EmitDefaultValue = true)] public List GroupedSigners { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The email addresses that should be CCed. /// /// The email addresses that should be CCed. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// 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` /// /// 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` [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] public bool HideTextTags { get; set; } - + /// /// 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. /// @@ -225,76 +225,76 @@ public static SignatureRequestSendRequest Init(string jsonData) [DataMember(Name = "is_qualified_signature", EmitDefaultValue = true)] [Obsolete] public bool IsQualifiedSignature { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "is_eid", EmitDefaultValue = true)] public bool IsEid { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] public bool UseTextTags { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -596,6 +596,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -758,34 +785,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs index e48cf04..4beed06 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestSendWithTemplateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestSendWithTemplateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestSendWithTemplateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestSendWithTemplateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -112,56 +112,56 @@ public static SignatureRequestSendWithTemplateRequest Init(string jsonData) /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the template will be used. [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// Add Signers to your Templated-based Signature Request. /// /// Add Signers to your Templated-based Signature Request. [DataMember(Name = "signers", IsRequired = true, EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// Add CC email recipients. Required when a CC role exists for the Template. /// /// Add CC email recipients. Required when a CC role exists for the Template. [DataMember(Name = "ccs", EmitDefaultValue = true)] public List Ccs { get; set; } - + /// /// Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. /// /// Client id of the app to associate with the signature request. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// 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. /// @@ -169,62 +169,62 @@ public static SignatureRequestSendWithTemplateRequest Init(string jsonData) [DataMember(Name = "is_qualified_signature", EmitDefaultValue = true)] [Obsolete] public bool IsQualifiedSignature { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "is_eid", EmitDefaultValue = true)] public bool IsEid { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Returns the string presentation of the object /// @@ -444,6 +444,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -552,34 +579,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SignatureRequestUpdateRequest.cs b/src/Dropbox.Sign/Model/SignatureRequestUpdateRequest.cs index 03570e7..eb7b8bc 100644 --- a/src/Dropbox.Sign/Model/SignatureRequestUpdateRequest.cs +++ b/src/Dropbox.Sign/Model/SignatureRequestUpdateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SignatureRequestUpdateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SignatureRequestUpdateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SignatureRequestUpdateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -81,28 +81,28 @@ public static SignatureRequestUpdateRequest Init(string jsonData) /// The signature ID for the recipient. [DataMember(Name = "signature_id", IsRequired = true, EmitDefaultValue = true)] public string SignatureId { get; set; } - + /// /// The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided. /// /// The new email address for the recipient. This will generate a new `signature_id` value. **NOTE:** Optional if `name` is provided. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The new name for the recipient. **NOTE:** Optional if `email_address` is provided. /// /// The new name for the recipient. **NOTE:** Optional if `email_address` is provided. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -201,6 +201,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -231,16 +240,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubAttachment.cs b/src/Dropbox.Sign/Model/SubAttachment.cs index 52a6afd..e941ee5 100644 --- a/src/Dropbox.Sign/Model/SubAttachment.cs +++ b/src/Dropbox.Sign/Model/SubAttachment.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubAttachment")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubAttachment : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubAttachment : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -81,28 +81,28 @@ public static SubAttachment Init(string jsonData) /// The name of attachment. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. /// /// The signer's index in the `signers` parameter (0-based indexing). **NOTE:** Only one signer can be assigned per attachment. [DataMember(Name = "signer_index", IsRequired = true, EmitDefaultValue = true)] public int SignerIndex { get; set; } - + /// /// The instructions for uploading the attachment. /// /// The instructions for uploading the attachment. [DataMember(Name = "instructions", EmitDefaultValue = true)] public string Instructions { get; set; } - + /// /// Determines if the attachment must be uploaded. /// /// Determines if the attachment must be uploaded. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// Returns the string presentation of the object /// @@ -193,6 +193,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -223,16 +232,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubBulkSignerList.cs b/src/Dropbox.Sign/Model/SubBulkSignerList.cs index 900ea91..1f05616 100644 --- a/src/Dropbox.Sign/Model/SubBulkSignerList.cs +++ b/src/Dropbox.Sign/Model/SubBulkSignerList.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubBulkSignerList")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubBulkSignerList : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubBulkSignerList : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static SubBulkSignerList Init(string jsonData) /// An array of custom field values. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Returns the string presentation of the object /// @@ -160,6 +160,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -178,16 +187,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubBulkSignerListCustomField.cs b/src/Dropbox.Sign/Model/SubBulkSignerListCustomField.cs index 2623b64..0c81056 100644 --- a/src/Dropbox.Sign/Model/SubBulkSignerListCustomField.cs +++ b/src/Dropbox.Sign/Model/SubBulkSignerListCustomField.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubBulkSignerListCustomField")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubBulkSignerListCustomField : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubBulkSignerListCustomField : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -82,14 +82,14 @@ public static SubBulkSignerListCustomField Init(string jsonData) /// The name of the custom field. Must be the field's `name` or `api_id`. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The value of the custom field. /// /// The value of the custom field. [DataMember(Name = "value", IsRequired = true, EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -168,6 +168,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -186,16 +195,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubCC.cs b/src/Dropbox.Sign/Model/SubCC.cs index 37d8b1f..1097fb4 100644 --- a/src/Dropbox.Sign/Model/SubCC.cs +++ b/src/Dropbox.Sign/Model/SubCC.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubCC")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubCC : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubCC : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -82,14 +82,14 @@ public static SubCC Init(string jsonData) /// Must match an existing CC role in chosen Template(s). Multiple CC recipients cannot share the same CC role. [DataMember(Name = "role", IsRequired = true, EmitDefaultValue = true)] public string Role { get; set; } - + /// /// The email address of the CC recipient. /// /// The email address of the CC recipient. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -168,6 +168,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -186,16 +195,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubCustomField.cs b/src/Dropbox.Sign/Model/SubCustomField.cs index ed49fb2..c6a0211 100644 --- a/src/Dropbox.Sign/Model/SubCustomField.cs +++ b/src/Dropbox.Sign/Model/SubCustomField.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubCustomField")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubCustomField : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubCustomField : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -81,28 +81,28 @@ public static SubCustomField Init(string jsonData) /// 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. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "editor", EmitDefaultValue = true)] public string Editor { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing. /// /// The string that resolves (aka \"pre-fills\") to the merge field on the final document(s) used for signing. [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// Returns the string presentation of the object /// @@ -197,6 +197,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -227,16 +236,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubEditorOptions.cs b/src/Dropbox.Sign/Model/SubEditorOptions.cs index 97e1581..531f778 100644 --- a/src/Dropbox.Sign/Model/SubEditorOptions.cs +++ b/src/Dropbox.Sign/Model/SubEditorOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubEditorOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubEditorOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubEditorOptions : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static SubEditorOptions Init(string jsonData) /// Allows requesters to edit the list of signers [DataMember(Name = "allow_edit_signers", EmitDefaultValue = true)] public bool AllowEditSigners { get; set; } - + /// /// Allows requesters to edit documents, including delete and add /// /// Allows requesters to edit documents, including delete and add [DataMember(Name = "allow_edit_documents", EmitDefaultValue = true)] public bool AllowEditDocuments { get; set; } - + /// /// Returns the string presentation of the object /// @@ -150,6 +150,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -168,16 +177,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFieldOptions.cs b/src/Dropbox.Sign/Model/SubFieldOptions.cs index 327e984..b281394 100644 --- a/src/Dropbox.Sign/Model/SubFieldOptions.cs +++ b/src/Dropbox.Sign/Model/SubFieldOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFieldOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFieldOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFieldOptions : IEquatable, IValidatableObject { /// /// Allows requester to specify the date format (see list of allowed [formats](/api/reference/constants/#date-formats)) **NOTE:** Only available for Premium and higher. @@ -75,7 +75,6 @@ public enum DateFormatEnum /// [EnumMember(Value = "YYYY - MM - DD")] YYYY_MM_DD = 6 - } @@ -180,6 +179,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -192,16 +200,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldGroup.cs b/src/Dropbox.Sign/Model/SubFormFieldGroup.cs index b842f8b..78910c7 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldGroup.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldGroup.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFormFieldGroup")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFormFieldGroup : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFormFieldGroup : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -89,21 +89,21 @@ public static SubFormFieldGroup Init(string jsonData) /// ID of group. Use this to reference a specific group from the `group` value in `form_fields_per_document`. [DataMember(Name = "group_id", IsRequired = true, EmitDefaultValue = true)] public string GroupId { get; set; } - + /// /// Name of the group /// /// Name of the group [DataMember(Name = "group_label", IsRequired = true, EmitDefaultValue = true)] public string GroupLabel { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "requirement", IsRequired = true, EmitDefaultValue = true)] public string Requirement { get; set; } - + /// /// Returns the string presentation of the object /// @@ -192,6 +192,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -216,16 +225,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldRule.cs b/src/Dropbox.Sign/Model/SubFormFieldRule.cs index 9a87581..e385fd1 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldRule.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldRule.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFormFieldRule")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFormFieldRule : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFormFieldRule : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -45,7 +45,7 @@ protected SubFormFieldRule() { } /// Currently only `AND` is supported. Support for `OR` is being worked on. (required) (default to "AND"). /// An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. (required). /// 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. (required). - public SubFormFieldRule(string id = default(string), string triggerOperator = "AND", List triggers = default(List), List actions = default(List)) + public SubFormFieldRule(string id = default(string), string triggerOperator = @"AND", List triggers = default(List), List actions = default(List)) { // to ensure "id" is required (not null) @@ -96,28 +96,28 @@ public static SubFormFieldRule Init(string jsonData) /// Must be unique across all defined rules. [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] public string Id { get; set; } - + /// /// Currently only `AND` is supported. Support for `OR` is being worked on. /// /// Currently only `AND` is supported. Support for `OR` is being worked on. [DataMember(Name = "trigger_operator", IsRequired = true, EmitDefaultValue = true)] public string TriggerOperator { get; set; } - + /// /// An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. /// /// An array of trigger definitions, the \"if this\" part of \"**if this**, then that\". Currently only a single trigger per rule is allowed. [DataMember(Name = "triggers", IsRequired = true, EmitDefaultValue = true)] public List Triggers { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "actions", IsRequired = true, EmitDefaultValue = true)] public List Actions { get; set; } - + /// /// Returns the string presentation of the object /// @@ -218,6 +218,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -248,16 +257,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs b/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs index 81c3068..b7a5d0a 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldRuleAction.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFormFieldRuleAction")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFormFieldRuleAction : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFormFieldRuleAction : IEquatable, IValidatableObject { /// /// Defines Type @@ -50,7 +50,6 @@ public enum TypeEnum /// [EnumMember(Value = "change-group-visibility")] GroupVisibility = 2 - } @@ -102,21 +101,21 @@ public static SubFormFieldRuleAction Init(string jsonData) /// `true` to hide the target field when rule is satisfied, otherwise `false`. [DataMember(Name = "hidden", IsRequired = true, EmitDefaultValue = true)] public bool Hidden { get; set; } - + /// /// **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. /// /// **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. [DataMember(Name = "field_id", EmitDefaultValue = true)] public string FieldId { get; set; } - + /// /// **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. /// /// **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. [DataMember(Name = "group_id", EmitDefaultValue = true)] public string GroupId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -207,6 +206,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -237,16 +245,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldRuleTrigger.cs b/src/Dropbox.Sign/Model/SubFormFieldRuleTrigger.cs index 7645a09..af6728f 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldRuleTrigger.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldRuleTrigger.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFormFieldRuleTrigger")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFormFieldRuleTrigger : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFormFieldRuleTrigger : IEquatable, IValidatableObject { /// /// 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 @@ -69,7 +69,6 @@ public enum OperatorEnum /// [EnumMember(Value = "not")] Not = 5 - } @@ -88,10 +87,10 @@ protected SubFormFieldRuleTrigger() { } /// Initializes a new instance of the class. /// /// 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. (required). - /// 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 (required). + /// 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 (required). /// **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** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none`. - public SubFormFieldRuleTrigger(string id = default(string), OperatorEnum _operator = default(OperatorEnum), string value = default(string), List values = default(List)) + public SubFormFieldRuleTrigger(string id = default(string), OperatorEnum varOperator = default(OperatorEnum), string value = default(string), List values = default(List)) { // to ensure "id" is required (not null) @@ -100,7 +99,7 @@ protected SubFormFieldRuleTrigger() { } throw new ArgumentNullException("id is a required property for SubFormFieldRuleTrigger and cannot be null"); } this.Id = id; - this.Operator = _operator; + this.Operator = varOperator; this.Value = value; this.Values = values; } @@ -127,21 +126,21 @@ public static SubFormFieldRuleTrigger Init(string jsonData) /// 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. [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] public string Id { get; set; } - + /// /// **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` /// /// **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` [DataMember(Name = "value", EmitDefaultValue = true)] public string Value { get; set; } - + /// /// **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none` /// /// **values** or **value** is required, but not both. The values to match against **operator** when it is one of the following: - `any` - `none` [DataMember(Name = "values", EmitDefaultValue = true)] public List Values { get; set; } - + /// /// Returns the string presentation of the object /// @@ -237,6 +236,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -267,16 +275,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentBase.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentBase.cs index 2aae8ac..3b90d36 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentBase.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentBase.cs @@ -32,16 +32,6 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubFormFieldsPerDocumentBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "SubFormFieldsPerDocumentCheckbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "SubFormFieldsPerDocumentCheckboxMerge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "SubFormFieldsPerDocumentDateSigned")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "SubFormFieldsPerDocumentDropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "SubFormFieldsPerDocumentHyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "SubFormFieldsPerDocumentInitials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "SubFormFieldsPerDocumentRadio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "SubFormFieldsPerDocumentSignature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "SubFormFieldsPerDocumentText")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "SubFormFieldsPerDocumentTextMerge")] [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] @@ -53,7 +43,7 @@ namespace Dropbox.Sign.Model [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubFormFieldsPerDocumentBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubFormFieldsPerDocumentBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -127,28 +117,28 @@ public static SubFormFieldsPerDocumentBase Init(string jsonData) /// Represents the integer index of the `file` or `file_url` document the field should be attached to. [DataMember(Name = "document_index", IsRequired = true, EmitDefaultValue = true)] public int DocumentIndex { get; set; } - + /// /// An identifier for the field that is unique across all documents in the request. /// /// An identifier for the field that is unique across all documents in the request. [DataMember(Name = "api_id", IsRequired = true, EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// Size of the field in pixels. /// /// Size of the field in pixels. [DataMember(Name = "height", IsRequired = true, EmitDefaultValue = true)] public int Height { get; set; } - + /// /// Whether this field is required. /// /// Whether this field is required. [DataMember(Name = "required", IsRequired = true, EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// 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. /// @@ -160,48 +150,47 @@ public object Signer { } private string _signer; - /// /// Gets or Sets Type /// [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Size of the field in pixels. /// /// Size of the field in pixels. [DataMember(Name = "width", IsRequired = true, EmitDefaultValue = true)] public int Width { get; set; } - + /// /// Location coordinates of the field in pixels. /// /// Location coordinates of the field in pixels. [DataMember(Name = "x", IsRequired = true, EmitDefaultValue = true)] public int X { get; set; } - + /// /// Location coordinates of the field in pixels. /// /// Location coordinates of the field in pixels. [DataMember(Name = "y", IsRequired = true, EmitDefaultValue = true)] public int Y { get; set; } - + /// /// Display name for the field. /// /// Display name for the field. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// 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 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. [DataMember(Name = "page", EmitDefaultValue = true)] public int? Page { get; set; } - + /// /// Returns the string presentation of the object /// @@ -346,6 +335,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -418,26 +426,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckbox.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckbox.cs index bd946a6..5123fdd 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckbox.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentCheckbox : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -66,7 +54,7 @@ protected SubFormFieldsPerDocumentCheckbox() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentCheckbox(string type = "checkbox", string group = default(string), bool isChecked = default(bool), int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentCheckbox(string type = @"checkbox", string group = default(string), bool isChecked = default(bool), int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -111,21 +99,21 @@ public static SubFormFieldsPerDocumentCheckbox Init(string jsonData) /// A yes/no checkbox. Use the `SubFormFieldsPerDocumentCheckbox` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// `true` for checking the checkbox field by default, otherwise `false`. /// /// `true` for checking the checkbox field by default, otherwise `false`. [DataMember(Name = "is_checked", IsRequired = true, EmitDefaultValue = true)] public bool IsChecked { get; set; } - + /// /// String referencing group defined in `form_field_groups` parameter. /// /// String referencing group defined in `form_field_groups` parameter. [DataMember(Name = "group", EmitDefaultValue = true)] public string Group { get; set; } - + /// /// Returns the string presentation of the object /// @@ -211,6 +199,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -235,30 +246,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckboxMerge.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckboxMerge.cs index 9c841b6..f3e5785 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckboxMerge.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentCheckboxMerge.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentCheckboxMerge")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentCheckboxMerge : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -64,7 +52,7 @@ protected SubFormFieldsPerDocumentCheckboxMerge() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentCheckboxMerge(string type = "checkbox-merge", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentCheckboxMerge(string type = @"checkbox-merge", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -107,7 +95,7 @@ public static SubFormFieldsPerDocumentCheckboxMerge Init(string jsonData) /// A checkbox field that has default value set using pre-filled data. Use the `SubFormFieldsPerDocumentCheckboxMerge` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,25 +165,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -205,7 +180,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -213,6 +188,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDateSigned.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDateSigned.cs index f6458c2..0706d57 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDateSigned.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDateSigned.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentDateSigned")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentDateSigned : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -147,7 +135,6 @@ public enum FontFamilyEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } @@ -178,7 +165,7 @@ protected SubFormFieldsPerDocumentDateSigned() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentDateSigned(string type = "date_signed", FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentDateSigned(string type = @"date_signed", FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -223,14 +210,14 @@ public static SubFormFieldsPerDocumentDateSigned Init(string jsonData) /// A date. Use the `SubFormFieldsPerDocumentDateSigned` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "font_size", EmitDefaultValue = true)] public int FontSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -312,6 +299,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -336,30 +346,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDropdown.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDropdown.cs index 42b9c67..c996ae2 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDropdown.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentDropdown.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentDropdown")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentDropdown : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -147,7 +135,6 @@ public enum FontFamilyEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } @@ -180,7 +167,7 @@ protected SubFormFieldsPerDocumentDropdown() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentDropdown(string type = "dropdown", List options = default(List), string content = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentDropdown(string type = @"dropdown", List options = default(List), string content = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -232,28 +219,28 @@ public static SubFormFieldsPerDocumentDropdown Init(string jsonData) /// An input field for dropdowns. Use the `SubFormFieldsPerDocumentDropdown` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Array of string values representing dropdown values. /// /// Array of string values representing dropdown values. [DataMember(Name = "options", IsRequired = true, EmitDefaultValue = true)] public List Options { get; set; } - + /// /// Selected value in `options` array. Value must exist in array. /// /// Selected value in `options` array. Value must exist in array. [DataMember(Name = "content", EmitDefaultValue = true)] public string Content { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "font_size", EmitDefaultValue = true)] public int FontSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -356,6 +343,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -392,30 +402,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentFontEnum.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentFontEnum.cs index 692aace..84b4ad0 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentFontEnum.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentFontEnum.cs @@ -127,7 +127,6 @@ public enum SubFormFieldsPerDocumentFontEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentHyperlink.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentHyperlink.cs index 2d3e4ce..52961a7 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentHyperlink.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentHyperlink.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentHyperlink")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentHyperlink : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -147,7 +135,6 @@ public enum FontFamilyEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } @@ -180,7 +167,7 @@ protected SubFormFieldsPerDocumentHyperlink() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentHyperlink(string type = "hyperlink", string content = default(string), string contentUrl = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentHyperlink(string type = @"hyperlink", string content = default(string), string contentUrl = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -237,28 +224,28 @@ public static SubFormFieldsPerDocumentHyperlink Init(string jsonData) /// A hyperlink field. Use the `SubFormFieldsPerDocumentHyperlink` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Link Text. /// /// Link Text. [DataMember(Name = "content", IsRequired = true, EmitDefaultValue = true)] public string Content { get; set; } - + /// /// Link URL. /// /// Link URL. [DataMember(Name = "content_url", IsRequired = true, EmitDefaultValue = true)] public string ContentUrl { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "font_size", EmitDefaultValue = true)] public int FontSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -360,6 +347,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -396,30 +406,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentInitials.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentInitials.cs index aca13bc..729c873 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentInitials.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentInitials.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentInitials")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentInitials : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -64,7 +52,7 @@ protected SubFormFieldsPerDocumentInitials() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentInitials(string type = "initials", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentInitials(string type = @"initials", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -107,7 +95,7 @@ public static SubFormFieldsPerDocumentInitials Init(string jsonData) /// An input field for initials. Use the `SubFormFieldsPerDocumentInitials` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,25 +165,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -205,7 +180,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -213,6 +188,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentRadio.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentRadio.cs index 7ea8dbe..10fc88e 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentRadio.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentRadio.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentRadio")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentRadio : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -66,7 +54,7 @@ protected SubFormFieldsPerDocumentRadio() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentRadio(string type = "radio", string group = default(string), bool isChecked = default(bool), int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentRadio(string type = @"radio", string group = default(string), bool isChecked = default(bool), int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -116,21 +104,21 @@ public static SubFormFieldsPerDocumentRadio Init(string jsonData) /// An input field for radios. Use the `SubFormFieldsPerDocumentRadio` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// String referencing group defined in `form_field_groups` parameter. /// /// String referencing group defined in `form_field_groups` parameter. [DataMember(Name = "group", IsRequired = true, EmitDefaultValue = true)] public string Group { get; set; } - + /// /// `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. /// /// `true` for checking the radio field by default, otherwise `false`. Only one radio field per group can be `true`. [DataMember(Name = "is_checked", IsRequired = true, EmitDefaultValue = true)] public bool IsChecked { get; set; } - + /// /// Returns the string presentation of the object /// @@ -216,6 +204,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -240,30 +251,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentSignature.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentSignature.cs index bf5a59a..bff60b6 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentSignature.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentSignature.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentSignature")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentSignature : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -64,7 +52,7 @@ protected SubFormFieldsPerDocumentSignature() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentSignature(string type = "signature", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentSignature(string type = @"signature", int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -107,7 +95,7 @@ public static SubFormFieldsPerDocumentSignature Init(string jsonData) /// A signature input field. Use the `SubFormFieldsPerDocumentSignature` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,25 +165,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -205,7 +180,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -213,6 +188,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentText.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentText.cs index bea6ff4..e0244d8 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentText.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentText : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -111,7 +99,6 @@ public enum ValidationTypeEnum /// [EnumMember(Value = "custom_regex")] CustomRegex = 10 - } @@ -223,7 +210,6 @@ public enum FontFamilyEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } @@ -262,7 +248,7 @@ protected SubFormFieldsPerDocumentText() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentText(string type = "text", string placeholder = default(string), string autoFillType = default(string), string linkId = default(string), bool masked = default(bool), ValidationTypeEnum? validationType = default(ValidationTypeEnum?), string validationCustomRegex = default(string), string validationCustomRegexFormatLabel = default(string), string content = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentText(string type = @"text", string placeholder = default(string), string autoFillType = default(string), string linkId = default(string), bool masked = default(bool), ValidationTypeEnum? validationType = default(ValidationTypeEnum?), string validationCustomRegex = default(string), string validationCustomRegexFormatLabel = default(string), string content = default(string), FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -315,61 +301,61 @@ public static SubFormFieldsPerDocumentText Init(string jsonData) /// A text input field. Use the `SubFormFieldsPerDocumentText` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Placeholder value for text field. /// /// Placeholder value for text field. [DataMember(Name = "placeholder", EmitDefaultValue = true)] public string Placeholder { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "auto_fill_type", EmitDefaultValue = true)] public string AutoFillType { get; set; } - + /// /// Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. /// /// Link two or more text fields. Enter data into one linked text field, which automatically fill all other linked text fields. [DataMember(Name = "link_id", EmitDefaultValue = true)] public string LinkId { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "masked", EmitDefaultValue = true)] public bool Masked { get; set; } - + /// /// Gets or Sets ValidationCustomRegex /// [DataMember(Name = "validation_custom_regex", EmitDefaultValue = true)] public string ValidationCustomRegex { get; set; } - + /// /// Gets or Sets ValidationCustomRegexFormatLabel /// [DataMember(Name = "validation_custom_regex_format_label", EmitDefaultValue = true)] public string ValidationCustomRegexFormatLabel { get; set; } - + /// /// Content of a `me_now` text field /// /// Content of a `me_now` text field [DataMember(Name = "content", EmitDefaultValue = true)] public string Content { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "font_size", EmitDefaultValue = true)] public int FontSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -523,6 +509,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -595,30 +604,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTextMerge.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTextMerge.cs index 0aca25e..127d20c 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTextMerge.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTextMerge.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,17 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `SubFormFieldsPerDocumentBase`. /// [DataContract(Name = "SubFormFieldsPerDocumentTextMerge")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentCheckboxMerge), "checkbox-merge")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentText), "text")] - [JsonSubtypes.KnownSubType(typeof(SubFormFieldsPerDocumentTextMerge), "text-merge")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class SubFormFieldsPerDocumentTextMerge : SubFormFieldsPerDocumentBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -147,7 +135,6 @@ public enum FontFamilyEnum /// [EnumMember(Value = "notoSanThaiMerged")] NotoSanThaiMerged = 16 - } @@ -178,7 +165,7 @@ protected SubFormFieldsPerDocumentTextMerge() { } /// Size of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). /// Location coordinates of the field in pixels. (required). - public SubFormFieldsPerDocumentTextMerge(string type = "text-merge", FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) + public SubFormFieldsPerDocumentTextMerge(string type = @"text-merge", FontFamilyEnum? fontFamily = default(FontFamilyEnum?), int fontSize = 12, int documentIndex = default(int), string apiId = default(string), int height = default(int), string name = default(string), int? page = default(int?), bool required = default(bool), Object signer = null, int width = default(int), int x = default(int), int y = default(int)) { this.DocumentIndex = documentIndex; this.ApiId = apiId; @@ -223,14 +210,14 @@ public static SubFormFieldsPerDocumentTextMerge Init(string jsonData) /// A text field that has default text set using pre-filled data. Use the `SubFormFieldsPerDocumentTextMerge` class. [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "font_size", EmitDefaultValue = true)] public int FontSize { get; set; } - + /// /// Returns the string presentation of the object /// @@ -312,6 +299,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -336,30 +346,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTypeEnum.cs b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTypeEnum.cs index f015837..4a45ad8 100644 --- a/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTypeEnum.cs +++ b/src/Dropbox.Sign/Model/SubFormFieldsPerDocumentTypeEnum.cs @@ -91,7 +91,6 @@ public enum SubFormFieldsPerDocumentTypeEnum /// [EnumMember(Value = "text-merge")] TextMerge = 10 - } } diff --git a/src/Dropbox.Sign/Model/SubMergeField.cs b/src/Dropbox.Sign/Model/SubMergeField.cs index 9e1f7dd..1799993 100644 --- a/src/Dropbox.Sign/Model/SubMergeField.cs +++ b/src/Dropbox.Sign/Model/SubMergeField.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubMergeField")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubMergeField : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubMergeField : IEquatable, IValidatableObject { /// /// The type of merge field. @@ -51,7 +51,6 @@ public enum TypeEnum /// [EnumMember(Value = "checkbox")] Checkbox = 2 - } @@ -105,7 +104,7 @@ public static SubMergeField Init(string jsonData) /// The name of the merge field. Must be unique. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -180,6 +179,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -198,16 +206,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubOAuth.cs b/src/Dropbox.Sign/Model/SubOAuth.cs index 52f502a..288a8d3 100644 --- a/src/Dropbox.Sign/Model/SubOAuth.cs +++ b/src/Dropbox.Sign/Model/SubOAuth.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubOAuth")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubOAuth : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubOAuth : IEquatable, IValidatableObject { /// /// Defines Scopes @@ -86,17 +86,8 @@ public enum ScopesEnum /// [EnumMember(Value = "")] Empty = 8 - } - - - /// - /// A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). - /// - /// A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). - [DataMember(Name = "scopes", EmitDefaultValue = true)] - public List Scopes { get; set; } /// /// Initializes a new instance of the class. /// @@ -136,7 +127,14 @@ public static SubOAuth Init(string jsonData) /// The callback URL to be used for OAuth flows. (Required if `oauth[scopes]` is provided) [DataMember(Name = "callback_url", EmitDefaultValue = true)] public string CallbackUrl { get; set; } - + + /// + /// A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). + /// + /// A list of [OAuth scopes](/api/reference/tag/OAuth) to be granted to the app. (Required if `oauth[callback_url]` is provided). + [DataMember(Name = "scopes", EmitDefaultValue = true)] + public List Scopes { get; set; } + /// /// Returns the string presentation of the object /// @@ -189,6 +187,8 @@ public bool Equals(SubOAuth input) ) && ( this.Scopes == input.Scopes || + this.Scopes != null && + input.Scopes != null && this.Scopes.SequenceEqual(input.Scopes) ); } @@ -206,11 +206,23 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.CallbackUrl.GetHashCode(); } - hashCode = (hashCode * 59) + this.Scopes.GetHashCode(); + if (this.Scopes != null) + { + hashCode = (hashCode * 59) + this.Scopes.GetHashCode(); + } return hashCode; } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -223,22 +235,12 @@ public List GetOpenApiTypes() types.Add(new OpenApiType(){ Name = "scopes", Property = "Scopes", - Type = "List", + Type = "List", Value = Scopes, }); return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubOptions.cs b/src/Dropbox.Sign/Model/SubOptions.cs index 82af0cf..1df55a3 100644 --- a/src/Dropbox.Sign/Model/SubOptions.cs +++ b/src/Dropbox.Sign/Model/SubOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubOptions : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static SubOptions Init(string jsonData) /// Determines if signers can use \"Insert Everywhere\" when signing a document. [DataMember(Name = "can_insert_everywhere", EmitDefaultValue = true)] public bool CanInsertEverywhere { get; set; } - + /// /// Returns the string presentation of the object /// @@ -135,6 +135,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -147,16 +156,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubSignatureRequestGroupedSigners.cs b/src/Dropbox.Sign/Model/SubSignatureRequestGroupedSigners.cs index 7b64469..7f1e2fa 100644 --- a/src/Dropbox.Sign/Model/SubSignatureRequestGroupedSigners.cs +++ b/src/Dropbox.Sign/Model/SubSignatureRequestGroupedSigners.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubSignatureRequestGroupedSigners")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubSignatureRequestGroupedSigners : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubSignatureRequestGroupedSigners : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -84,21 +84,21 @@ public static SubSignatureRequestGroupedSigners Init(string jsonData) /// The name of the group. [DataMember(Name = "group", IsRequired = true, EmitDefaultValue = true)] public string Group { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "signers", IsRequired = true, EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// The order the group is required to sign in. Use this instead of Signer-level `order`. /// /// The order the group is required to sign in. Use this instead of Signer-level `order`. [DataMember(Name = "order", EmitDefaultValue = true)] public int? Order { get; set; } - + /// /// Returns the string presentation of the object /// @@ -188,6 +188,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -212,16 +221,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubSignatureRequestSigner.cs b/src/Dropbox.Sign/Model/SubSignatureRequestSigner.cs index b666910..7b3a3f9 100644 --- a/src/Dropbox.Sign/Model/SubSignatureRequestSigner.cs +++ b/src/Dropbox.Sign/Model/SubSignatureRequestSigner.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubSignatureRequestSigner")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubSignatureRequestSigner : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubSignatureRequestSigner : IEquatable, IValidatableObject { /// /// 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). @@ -51,7 +51,6 @@ public enum SmsPhoneNumberTypeEnum /// [EnumMember(Value = "delivery")] Delivery = 2 - } @@ -118,35 +117,35 @@ public static SubSignatureRequestSigner Init(string jsonData) /// The name of the signer. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The email address of the signer. /// /// The email address of the signer. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The order the signer is required to sign in. /// /// The order the signer is required to sign in. [DataMember(Name = "order", EmitDefaultValue = true)] public int? Order { get; set; } - + /// /// The 4- to 12-character access code that will secure this signer's signature page. /// /// The 4- to 12-character access code that will secure this signer's signature page. [DataMember(Name = "pin", EmitDefaultValue = true)] public string Pin { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "sms_phone_number", EmitDefaultValue = true)] public string SmsPhoneNumber { get; set; } - + /// /// Returns the string presentation of the object /// @@ -261,6 +260,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Pin (string) maxLength + if (this.Pin != null && this.Pin.Length > 12) + { + yield return new ValidationResult("Invalid value for Pin, length must be less than 12.", new [] { "Pin" }); + } + + // Pin (string) minLength + if (this.Pin != null && this.Pin.Length < 4) + { + yield return new ValidationResult("Invalid value for Pin, length must be greater than 4.", new [] { "Pin" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -303,28 +323,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Pin (string) maxLength - if (this.Pin != null && this.Pin.Length > 12) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Pin, length must be less than 12.", new [] { "Pin" }); - } - - // Pin (string) minLength - if (this.Pin != null && this.Pin.Length < 4) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Pin, length must be greater than 4.", new [] { "Pin" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubSignatureRequestTemplateSigner.cs b/src/Dropbox.Sign/Model/SubSignatureRequestTemplateSigner.cs index 6f8b7a7..629a94d 100644 --- a/src/Dropbox.Sign/Model/SubSignatureRequestTemplateSigner.cs +++ b/src/Dropbox.Sign/Model/SubSignatureRequestTemplateSigner.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubSignatureRequestTemplateSigner")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubSignatureRequestTemplateSigner : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubSignatureRequestTemplateSigner : IEquatable, IValidatableObject { /// /// 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). @@ -51,7 +51,6 @@ public enum SmsPhoneNumberTypeEnum /// [EnumMember(Value = "delivery")] Delivery = 2 - } @@ -123,35 +122,35 @@ public static SubSignatureRequestTemplateSigner Init(string jsonData) /// Must match an existing role in chosen Template(s). It's case-sensitive. [DataMember(Name = "role", IsRequired = true, EmitDefaultValue = true)] public string Role { get; set; } - + /// /// The name of the signer. /// /// The name of the signer. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The email address of the signer. /// /// The email address of the signer. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The 4- to 12-character access code that will secure this signer's signature page. /// /// The 4- to 12-character access code that will secure this signer's signature page. [DataMember(Name = "pin", EmitDefaultValue = true)] public string Pin { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "sms_phone_number", EmitDefaultValue = true)] public string SmsPhoneNumber { get; set; } - + /// /// Returns the string presentation of the object /// @@ -266,6 +265,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Pin (string) maxLength + if (this.Pin != null && this.Pin.Length > 12) + { + yield return new ValidationResult("Invalid value for Pin, length must be less than 12.", new [] { "Pin" }); + } + + // Pin (string) minLength + if (this.Pin != null && this.Pin.Length < 4) + { + yield return new ValidationResult("Invalid value for Pin, length must be greater than 4.", new [] { "Pin" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -308,28 +328,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Pin (string) maxLength - if (this.Pin != null && this.Pin.Length > 12) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Pin, length must be less than 12.", new [] { "Pin" }); - } - - // Pin (string) minLength - if (this.Pin != null && this.Pin.Length < 4) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Pin, length must be greater than 4.", new [] { "Pin" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubSigningOptions.cs b/src/Dropbox.Sign/Model/SubSigningOptions.cs index 2aa89b5..c3d7007 100644 --- a/src/Dropbox.Sign/Model/SubSigningOptions.cs +++ b/src/Dropbox.Sign/Model/SubSigningOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubSigningOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubSigningOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubSigningOptions : IEquatable, IValidatableObject { /// /// The default type shown (limited to the listed types) @@ -63,7 +63,6 @@ public enum DefaultTypeEnum /// [EnumMember(Value = "upload")] Upload = 4 - } @@ -118,28 +117,28 @@ public static SubSigningOptions Init(string jsonData) /// Allows drawing the signature [DataMember(Name = "draw", EmitDefaultValue = true)] public bool Draw { get; set; } - + /// /// Allows using a smartphone to email the signature /// /// Allows using a smartphone to email the signature [DataMember(Name = "phone", EmitDefaultValue = true)] public bool Phone { get; set; } - + /// /// Allows typing the signature /// /// Allows typing the signature [DataMember(Name = "type", EmitDefaultValue = true)] public bool Type { get; set; } - + /// /// Allows uploading the signature /// /// Allows uploading the signature [DataMember(Name = "upload", EmitDefaultValue = true)] public bool Upload { get; set; } - + /// /// Returns the string presentation of the object /// @@ -228,6 +227,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -264,16 +272,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubTeamResponse.cs b/src/Dropbox.Sign/Model/SubTeamResponse.cs index b113555..53a6152 100644 --- a/src/Dropbox.Sign/Model/SubTeamResponse.cs +++ b/src/Dropbox.Sign/Model/SubTeamResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubTeamResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubTeamResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubTeamResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static SubTeamResponse Init(string jsonData) /// The id of a team [DataMember(Name = "team_id", EmitDefaultValue = true)] public string TeamId { get; set; } - + /// /// The name of a team /// /// The name of a team [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubTemplateRole.cs b/src/Dropbox.Sign/Model/SubTemplateRole.cs index 54a946e..6611d25 100644 --- a/src/Dropbox.Sign/Model/SubTemplateRole.cs +++ b/src/Dropbox.Sign/Model/SubTemplateRole.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubTemplateRole")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubTemplateRole : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubTemplateRole : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static SubTemplateRole Init(string jsonData) /// The role name of the signer that will be displayed when the template is used to create a signature request. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The order in which this signer role is required to sign. /// /// The order in which this signer role is required to sign. [DataMember(Name = "order", EmitDefaultValue = true)] public int? Order { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubUnclaimedDraftSigner.cs b/src/Dropbox.Sign/Model/SubUnclaimedDraftSigner.cs index 56479d9..fe9f934 100644 --- a/src/Dropbox.Sign/Model/SubUnclaimedDraftSigner.cs +++ b/src/Dropbox.Sign/Model/SubUnclaimedDraftSigner.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubUnclaimedDraftSigner")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubUnclaimedDraftSigner : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubUnclaimedDraftSigner : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -84,21 +84,21 @@ public static SubUnclaimedDraftSigner Init(string jsonData) /// The email address of the signer. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The name of the signer. /// /// The name of the signer. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The order the signer is required to sign in. /// /// The order the signer is required to sign in. [DataMember(Name = "order", EmitDefaultValue = true)] public int? Order { get; set; } - + /// /// Returns the string presentation of the object /// @@ -187,6 +187,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -211,16 +220,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubUnclaimedDraftTemplateSigner.cs b/src/Dropbox.Sign/Model/SubUnclaimedDraftTemplateSigner.cs index 1383c4f..3a2a6b8 100644 --- a/src/Dropbox.Sign/Model/SubUnclaimedDraftTemplateSigner.cs +++ b/src/Dropbox.Sign/Model/SubUnclaimedDraftTemplateSigner.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubUnclaimedDraftTemplateSigner")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubUnclaimedDraftTemplateSigner : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubUnclaimedDraftTemplateSigner : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -89,21 +89,21 @@ public static SubUnclaimedDraftTemplateSigner Init(string jsonData) /// Must match an existing role in chosen Template(s). [DataMember(Name = "role", IsRequired = true, EmitDefaultValue = true)] public string Role { get; set; } - + /// /// The name of the signer filling the role of `role`. /// /// The name of the signer filling the role of `role`. [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The email address of the signer filling the role of `role`. /// /// The email address of the signer filling the role of `role`. [DataMember(Name = "email_address", IsRequired = true, EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -192,6 +192,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -216,16 +225,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/SubWhiteLabelingOptions.cs b/src/Dropbox.Sign/Model/SubWhiteLabelingOptions.cs index 36996b6..6f11e2b 100644 --- a/src/Dropbox.Sign/Model/SubWhiteLabelingOptions.cs +++ b/src/Dropbox.Sign/Model/SubWhiteLabelingOptions.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "SubWhiteLabelingOptions")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class SubWhiteLabelingOptions : IOpenApiTyped, IEquatable, IValidatableObject + public partial class SubWhiteLabelingOptions : IEquatable, IValidatableObject { /// /// Defines LegalVersion @@ -50,7 +50,6 @@ public enum LegalVersionEnum /// [EnumMember(Value = "terms2")] Terms2 = 2 - } @@ -82,7 +81,7 @@ protected SubWhiteLabelingOptions() { } /// textColor1 (default to "#808080"). /// textColor2 (default to "#FFFFFF"). /// Resets white labeling options to defaults. Only useful when updating an API App.. - public SubWhiteLabelingOptions(string headerBackgroundColor = "#1A1A1A", LegalVersionEnum? legalVersion = LegalVersionEnum.Terms1, string linkColor = "#00B3E6", string pageBackgroundColor = "#F7F8F9", string primaryButtonColor = "#00B3E6", string primaryButtonColorHover = "#00B3E6", string primaryButtonTextColor = "#FFFFFF", string primaryButtonTextColorHover = "#FFFFFF", string secondaryButtonColor = "#FFFFFF", string secondaryButtonColorHover = "#FFFFFF", string secondaryButtonTextColor = "#00B3E6", string secondaryButtonTextColorHover = "#00B3E6", string textColor1 = "#808080", string textColor2 = "#FFFFFF", bool resetToDefault = default(bool)) + public SubWhiteLabelingOptions(string headerBackgroundColor = @"#1A1A1A", LegalVersionEnum? legalVersion = LegalVersionEnum.Terms1, string linkColor = @"#00B3E6", string pageBackgroundColor = @"#F7F8F9", string primaryButtonColor = @"#00B3E6", string primaryButtonColorHover = @"#00B3E6", string primaryButtonTextColor = @"#FFFFFF", string primaryButtonTextColorHover = @"#FFFFFF", string secondaryButtonColor = @"#FFFFFF", string secondaryButtonColorHover = @"#FFFFFF", string secondaryButtonTextColor = @"#00B3E6", string secondaryButtonTextColorHover = @"#00B3E6", string textColor1 = @"#808080", string textColor2 = @"#FFFFFF", bool resetToDefault = default(bool)) { // use default value if no "headerBackgroundColor" provided @@ -136,86 +135,86 @@ public static SubWhiteLabelingOptions Init(string jsonData) /// [DataMember(Name = "header_background_color", EmitDefaultValue = true)] public string HeaderBackgroundColor { get; set; } - + /// /// Gets or Sets LinkColor /// [DataMember(Name = "link_color", EmitDefaultValue = true)] public string LinkColor { get; set; } - + /// /// Gets or Sets PageBackgroundColor /// [DataMember(Name = "page_background_color", EmitDefaultValue = true)] public string PageBackgroundColor { get; set; } - + /// /// Gets or Sets PrimaryButtonColor /// [DataMember(Name = "primary_button_color", EmitDefaultValue = true)] public string PrimaryButtonColor { get; set; } - + /// /// Gets or Sets PrimaryButtonColorHover /// [DataMember(Name = "primary_button_color_hover", EmitDefaultValue = true)] public string PrimaryButtonColorHover { get; set; } - + /// /// Gets or Sets PrimaryButtonTextColor /// [DataMember(Name = "primary_button_text_color", EmitDefaultValue = true)] public string PrimaryButtonTextColor { get; set; } - + /// /// Gets or Sets PrimaryButtonTextColorHover /// [DataMember(Name = "primary_button_text_color_hover", EmitDefaultValue = true)] public string PrimaryButtonTextColorHover { get; set; } - + /// /// Gets or Sets SecondaryButtonColor /// [DataMember(Name = "secondary_button_color", EmitDefaultValue = true)] public string SecondaryButtonColor { get; set; } - + /// /// Gets or Sets SecondaryButtonColorHover /// [DataMember(Name = "secondary_button_color_hover", EmitDefaultValue = true)] public string SecondaryButtonColorHover { get; set; } - + /// /// Gets or Sets SecondaryButtonTextColor /// [DataMember(Name = "secondary_button_text_color", EmitDefaultValue = true)] public string SecondaryButtonTextColor { get; set; } - + /// /// Gets or Sets SecondaryButtonTextColorHover /// [DataMember(Name = "secondary_button_text_color_hover", EmitDefaultValue = true)] public string SecondaryButtonTextColorHover { get; set; } - + /// /// Gets or Sets TextColor1 /// [DataMember(Name = "text_color1", EmitDefaultValue = true)] public string TextColor1 { get; set; } - + /// /// Gets or Sets TextColor2 /// [DataMember(Name = "text_color2", EmitDefaultValue = true)] public string TextColor2 { get; set; } - + /// /// Resets white labeling options to defaults. Only useful when updating an API App. /// /// Resets white labeling options to defaults. Only useful when updating an API App. [DataMember(Name = "reset_to_default", EmitDefaultValue = true)] public bool ResetToDefault { get; set; } - + /// /// Returns the string presentation of the object /// @@ -416,6 +415,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -512,16 +520,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamAddMemberRequest.cs b/src/Dropbox.Sign/Model/TeamAddMemberRequest.cs index 0f3cfe2..9c988a2 100644 --- a/src/Dropbox.Sign/Model/TeamAddMemberRequest.cs +++ b/src/Dropbox.Sign/Model/TeamAddMemberRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamAddMemberRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamAddMemberRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamAddMemberRequest : IEquatable, IValidatableObject { /// /// A role member will take in a new Team. **NOTE:** This parameter is used only if `team_id` is provided. @@ -63,7 +63,6 @@ public enum RoleEnum /// [EnumMember(Value = "Admin")] Admin = 4 - } @@ -114,14 +113,14 @@ public static TeamAddMemberRequest Init(string jsonData) /// `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. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// `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. /// /// `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. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -206,6 +205,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -230,16 +238,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamCreateRequest.cs b/src/Dropbox.Sign/Model/TeamCreateRequest.cs index 50a199e..a73122b 100644 --- a/src/Dropbox.Sign/Model/TeamCreateRequest.cs +++ b/src/Dropbox.Sign/Model/TeamCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamCreateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -42,7 +42,7 @@ protected TeamCreateRequest() { } /// Initializes a new instance of the class. /// /// The name of your Team. (default to "Untitled Team"). - public TeamCreateRequest(string name = "Untitled Team") + public TeamCreateRequest(string name = @"Untitled Team") { // use default value if no "name" provided @@ -71,7 +71,7 @@ public static TeamCreateRequest Init(string jsonData) /// The name of your Team. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -140,6 +140,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -152,16 +161,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamGetInfoResponse.cs b/src/Dropbox.Sign/Model/TeamGetInfoResponse.cs index 10bda49..47afb05 100644 --- a/src/Dropbox.Sign/Model/TeamGetInfoResponse.cs +++ b/src/Dropbox.Sign/Model/TeamGetInfoResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamGetInfoResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamGetInfoResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamGetInfoResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TeamGetInfoResponse() { } /// /// Initializes a new instance of the class. /// - /// team. + /// team (required). /// A list of warnings.. public TeamGetInfoResponse(TeamInfoResponse team = default(TeamInfoResponse), List warnings = default(List)) { + // to ensure "team" is required (not null) + if (team == null) + { + throw new ArgumentNullException("team is a required property for TeamGetInfoResponse and cannot be null"); + } this.Team = team; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static TeamGetInfoResponse Init(string jsonData) /// /// Gets or Sets Team /// - [DataMember(Name = "team", EmitDefaultValue = true)] + [DataMember(Name = "team", IsRequired = true, EmitDefaultValue = true)] public TeamInfoResponse Team { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamGetResponse.cs b/src/Dropbox.Sign/Model/TeamGetResponse.cs index 2087aa2..db7efe0 100644 --- a/src/Dropbox.Sign/Model/TeamGetResponse.cs +++ b/src/Dropbox.Sign/Model/TeamGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TeamGetResponse() { } /// /// Initializes a new instance of the class. /// - /// team. + /// team (required). /// A list of warnings.. public TeamGetResponse(TeamResponse team = default(TeamResponse), List warnings = default(List)) { + // to ensure "team" is required (not null) + if (team == null) + { + throw new ArgumentNullException("team is a required property for TeamGetResponse and cannot be null"); + } this.Team = team; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static TeamGetResponse Init(string jsonData) /// /// Gets or Sets Team /// - [DataMember(Name = "team", EmitDefaultValue = true)] + [DataMember(Name = "team", IsRequired = true, EmitDefaultValue = true)] public TeamResponse Team { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamInfoResponse.cs b/src/Dropbox.Sign/Model/TeamInfoResponse.cs index 0375658..b35c7a8 100644 --- a/src/Dropbox.Sign/Model/TeamInfoResponse.cs +++ b/src/Dropbox.Sign/Model/TeamInfoResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamInfoResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamInfoResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamInfoResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -78,34 +78,34 @@ public static TeamInfoResponse Init(string jsonData) /// The id of a team [DataMember(Name = "team_id", EmitDefaultValue = true)] public string TeamId { get; set; } - + /// /// Gets or Sets TeamParent /// [DataMember(Name = "team_parent", EmitDefaultValue = true)] public TeamParentResponse TeamParent { get; set; } - + /// /// The name of a team /// /// The name of a team [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Number of members within a team /// /// Number of members within a team [DataMember(Name = "num_members", EmitDefaultValue = true)] public int NumMembers { get; set; } - + /// /// Number of sub teams within a team /// /// Number of sub teams within a team [DataMember(Name = "num_sub_teams", EmitDefaultValue = true)] public int NumSubTeams { get; set; } - + /// /// Returns the string presentation of the object /// @@ -206,6 +206,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -242,16 +251,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamInviteResponse.cs b/src/Dropbox.Sign/Model/TeamInviteResponse.cs index 67a22d2..2361183 100644 --- a/src/Dropbox.Sign/Model/TeamInviteResponse.cs +++ b/src/Dropbox.Sign/Model/TeamInviteResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamInviteResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamInviteResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamInviteResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,42 +80,42 @@ public static TeamInviteResponse Init(string jsonData) /// Email address of the user invited to this team. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Id of the team. /// /// Id of the team. [DataMember(Name = "team_id", EmitDefaultValue = true)] public string TeamId { get; set; } - + /// /// Role of the user invited to this team. /// /// Role of the user invited to this team. [DataMember(Name = "role", EmitDefaultValue = true)] public string Role { get; set; } - + /// /// Timestamp when the invitation was sent. /// /// Timestamp when the invitation was sent. [DataMember(Name = "sent_at", EmitDefaultValue = true)] public int SentAt { get; set; } - + /// /// Timestamp when the invitation was redeemed. /// /// Timestamp when the invitation was redeemed. [DataMember(Name = "redeemed_at", EmitDefaultValue = true)] public int RedeemedAt { get; set; } - + /// /// Timestamp when the invitation is expiring. /// /// Timestamp when the invitation is expiring. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -222,6 +222,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -264,16 +273,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamInvitesResponse.cs b/src/Dropbox.Sign/Model/TeamInvitesResponse.cs index c06401f..b4d6570 100644 --- a/src/Dropbox.Sign/Model/TeamInvitesResponse.cs +++ b/src/Dropbox.Sign/Model/TeamInvitesResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamInvitesResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamInvitesResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamInvitesResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TeamInvitesResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains a list of team invites and their roles.. + /// Contains a list of team invites and their roles. (required). /// warnings. public TeamInvitesResponse(List teamInvites = default(List), List warnings = default(List)) { + // to ensure "teamInvites" is required (not null) + if (teamInvites == null) + { + throw new ArgumentNullException("teamInvites is a required property for TeamInvitesResponse and cannot be null"); + } this.TeamInvites = teamInvites; this.Warnings = warnings; } @@ -70,15 +75,15 @@ public static TeamInvitesResponse Init(string jsonData) /// Contains a list of team invites and their roles. /// /// Contains a list of team invites and their roles. - [DataMember(Name = "team_invites", EmitDefaultValue = true)] + [DataMember(Name = "team_invites", IsRequired = true, EmitDefaultValue = true)] public List TeamInvites { get; set; } - + /// /// Gets or Sets Warnings /// [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -159,6 +164,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -177,16 +191,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamMemberResponse.cs b/src/Dropbox.Sign/Model/TeamMemberResponse.cs index 3273ae1..5eb2d0c 100644 --- a/src/Dropbox.Sign/Model/TeamMemberResponse.cs +++ b/src/Dropbox.Sign/Model/TeamMemberResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamMemberResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamMemberResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamMemberResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -74,21 +74,21 @@ public static TeamMemberResponse Init(string jsonData) /// Account id of the team member. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// Email address of the team member. /// /// Email address of the team member. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// The specific role a member has on the team. /// /// The specific role a member has on the team. [DataMember(Name = "role", EmitDefaultValue = true)] public string Role { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,6 +177,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -201,16 +210,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamMembersResponse.cs b/src/Dropbox.Sign/Model/TeamMembersResponse.cs index c0578d5..e4ed27d 100644 --- a/src/Dropbox.Sign/Model/TeamMembersResponse.cs +++ b/src/Dropbox.Sign/Model/TeamMembersResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamMembersResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamMembersResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamMembersResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected TeamMembersResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains a list of team members and their roles for a specific team.. - /// listInfo. + /// Contains a list of team members and their roles for a specific team. (required). + /// listInfo (required). /// warnings. public TeamMembersResponse(List teamMembers = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "teamMembers" is required (not null) + if (teamMembers == null) + { + throw new ArgumentNullException("teamMembers is a required property for TeamMembersResponse and cannot be null"); + } this.TeamMembers = teamMembers; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for TeamMembersResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,21 +82,21 @@ public static TeamMembersResponse Init(string jsonData) /// Contains a list of team members and their roles for a specific team. /// /// Contains a list of team members and their roles for a specific team. - [DataMember(Name = "team_members", EmitDefaultValue = true)] + [DataMember(Name = "team_members", IsRequired = true, EmitDefaultValue = true)] public List TeamMembers { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { get; set; } - + /// /// Gets or Sets Warnings /// [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,6 +187,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -201,16 +220,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamParentResponse.cs b/src/Dropbox.Sign/Model/TeamParentResponse.cs index 3149932..30730d6 100644 --- a/src/Dropbox.Sign/Model/TeamParentResponse.cs +++ b/src/Dropbox.Sign/Model/TeamParentResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamParentResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamParentResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamParentResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static TeamParentResponse Init(string jsonData) /// The id of a team [DataMember(Name = "team_id", EmitDefaultValue = true)] public string TeamId { get; set; } - + /// /// The name of a team /// /// The name of a team [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamRemoveMemberRequest.cs b/src/Dropbox.Sign/Model/TeamRemoveMemberRequest.cs index e12e94f..2d8d606 100644 --- a/src/Dropbox.Sign/Model/TeamRemoveMemberRequest.cs +++ b/src/Dropbox.Sign/Model/TeamRemoveMemberRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamRemoveMemberRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamRemoveMemberRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamRemoveMemberRequest : IEquatable, IValidatableObject { /// /// A new role member will take in a new Team. **NOTE:** This parameter is used only if `new_team_id` is provided. @@ -63,7 +63,6 @@ public enum NewRoleEnum /// [EnumMember(Value = "Admin")] Admin = 4 - } @@ -118,28 +117,28 @@ public static TeamRemoveMemberRequest Init(string jsonData) /// **account_id** or **email_address** is required. If both are provided, the account id prevails. Account id to remove from your Team. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// **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. /// /// **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. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "new_owner_email_address", EmitDefaultValue = true)] public string NewOwnerEmailAddress { get; set; } - + /// /// Id of the new Team. /// /// Id of the new Team. [DataMember(Name = "new_team_id", EmitDefaultValue = true)] public string NewTeamId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -244,6 +243,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -280,16 +288,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamResponse.cs b/src/Dropbox.Sign/Model/TeamResponse.cs index 99ddc30..fd47071 100644 --- a/src/Dropbox.Sign/Model/TeamResponse.cs +++ b/src/Dropbox.Sign/Model/TeamResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,27 +76,27 @@ public static TeamResponse Init(string jsonData) /// The name of your Team [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Gets or Sets Accounts /// [DataMember(Name = "accounts", EmitDefaultValue = true)] public List Accounts { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "invited_accounts", EmitDefaultValue = true)] public List InvitedAccounts { get; set; } - + /// /// A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. /// /// A list of email addresses that have an outstanding invitation to join your Team and do not yet have a Dropbox Sign account. [DataMember(Name = "invited_emails", EmitDefaultValue = true)] public List InvitedEmails { get; set; } - + /// /// Returns the string presentation of the object /// @@ -198,6 +198,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -228,16 +237,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamSubTeamsResponse.cs b/src/Dropbox.Sign/Model/TeamSubTeamsResponse.cs index 0cb396f..5c525df 100644 --- a/src/Dropbox.Sign/Model/TeamSubTeamsResponse.cs +++ b/src/Dropbox.Sign/Model/TeamSubTeamsResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamSubTeamsResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamSubTeamsResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamSubTeamsResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected TeamSubTeamsResponse() { } /// /// Initializes a new instance of the class. /// - /// Contains a list with sub teams.. - /// listInfo. + /// Contains a list with sub teams. (required). + /// listInfo (required). /// warnings. public TeamSubTeamsResponse(List subTeams = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "subTeams" is required (not null) + if (subTeams == null) + { + throw new ArgumentNullException("subTeams is a required property for TeamSubTeamsResponse and cannot be null"); + } this.SubTeams = subTeams; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for TeamSubTeamsResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,21 +82,21 @@ public static TeamSubTeamsResponse Init(string jsonData) /// Contains a list with sub teams. /// /// Contains a list with sub teams. - [DataMember(Name = "sub_teams", EmitDefaultValue = true)] + [DataMember(Name = "sub_teams", IsRequired = true, EmitDefaultValue = true)] public List SubTeams { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { get; set; } - + /// /// Gets or Sets Warnings /// [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -177,6 +187,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -201,16 +220,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TeamUpdateRequest.cs b/src/Dropbox.Sign/Model/TeamUpdateRequest.cs index ca0b087..4d555f8 100644 --- a/src/Dropbox.Sign/Model/TeamUpdateRequest.cs +++ b/src/Dropbox.Sign/Model/TeamUpdateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TeamUpdateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TeamUpdateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TeamUpdateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static TeamUpdateRequest Init(string jsonData) /// The name of your Team. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +139,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -151,16 +160,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateAddUserRequest.cs b/src/Dropbox.Sign/Model/TemplateAddUserRequest.cs index 65f0551..658f781 100644 --- a/src/Dropbox.Sign/Model/TemplateAddUserRequest.cs +++ b/src/Dropbox.Sign/Model/TemplateAddUserRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateAddUserRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateAddUserRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateAddUserRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -74,21 +74,21 @@ public static TemplateAddUserRequest Init(string jsonData) /// The id of the Account to give access to the Template. **NOTE:** The account id prevails if email address is also provided. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided. /// /// The email address of the Account to give access to the Template. **NOTE:** The account id prevails if it is also provided. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. /// /// If set to `true`, the user does not receive an email notification when a template has been shared with them. Defaults to `false`. [DataMember(Name = "skip_notification", EmitDefaultValue = true)] public bool SkipNotification { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,6 +173,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -197,16 +206,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftRequest.cs b/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftRequest.cs index 1acfdd7..2bcd918 100644 --- a/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftRequest.cs +++ b/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateEmbeddedDraftRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateEmbeddedDraftRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateEmbeddedDraftRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -123,173 +123,173 @@ public static TemplateCreateEmbeddedDraftRequest Init(string jsonData) /// Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when creating a template. [DataMember(Name = "allow_ccs", EmitDefaultValue = true)] public bool AllowCcs { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The CC roles that must be assigned when using the template to send a signature request /// /// The CC roles that must be assigned when using the template to send a signature request [DataMember(Name = "cc_roles", EmitDefaultValue = true)] public List CcRoles { get; set; } - + /// /// Gets or Sets EditorOptions /// [DataMember(Name = "editor_options", EmitDefaultValue = true)] public SubEditorOptions EditorOptions { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// Provide users the ability to review/edit the template signer roles. /// /// Provide users the ability to review/edit the template signer roles. [DataMember(Name = "force_signer_roles", EmitDefaultValue = true)] public bool ForceSignerRoles { get; set; } - + /// /// Provide users the ability to review/edit the template subject and message. /// /// Provide users the ability to review/edit the template subject and message. [DataMember(Name = "force_subject_message", EmitDefaultValue = true)] public bool ForceSubjectMessage { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// 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` /// /// 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` [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "merge_fields", EmitDefaultValue = true)] public List MergeFields { get; set; } - + /// /// The default template email message. /// /// The default template email message. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "show_preview", EmitDefaultValue = true)] public bool ShowPreview { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. [DataMember(Name = "signer_roles", EmitDefaultValue = true)] public List SignerRoles { get; set; } - + /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. [DataMember(Name = "skip_me_now", EmitDefaultValue = true)] public bool SkipMeNow { get; set; } - + /// /// The template title (alias). /// /// The template title (alias). [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). /// /// Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). [DataMember(Name = "use_preexisting_fields", EmitDefaultValue = true)] public bool UsePreexistingFields { get; set; } - + /// /// Returns the string presentation of the object /// @@ -572,6 +572,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 200) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -728,28 +749,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 200) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponse.cs b/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponse.cs index 7ba9b8d..4bdc647 100644 --- a/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponse.cs +++ b/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateEmbeddedDraftResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateEmbeddedDraftResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateEmbeddedDraftResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TemplateCreateEmbeddedDraftResponse() { } /// /// Initializes a new instance of the class. /// - /// template. + /// template (required). /// A list of warnings.. public TemplateCreateEmbeddedDraftResponse(TemplateCreateEmbeddedDraftResponseTemplate template = default(TemplateCreateEmbeddedDraftResponseTemplate), List warnings = default(List)) { + // to ensure "template" is required (not null) + if (template == null) + { + throw new ArgumentNullException("template is a required property for TemplateCreateEmbeddedDraftResponse and cannot be null"); + } this.Template = template; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static TemplateCreateEmbeddedDraftResponse Init(string jsonData) /// /// Gets or Sets Template /// - [DataMember(Name = "template", EmitDefaultValue = true)] + [DataMember(Name = "template", IsRequired = true, EmitDefaultValue = true)] public TemplateCreateEmbeddedDraftResponseTemplate Template { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponseTemplate.cs b/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponseTemplate.cs index e25ebf0..23510e0 100644 --- a/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponseTemplate.cs +++ b/src/Dropbox.Sign/Model/TemplateCreateEmbeddedDraftResponseTemplate.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateEmbeddedDraftResponseTemplate")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateEmbeddedDraftResponseTemplate : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateEmbeddedDraftResponseTemplate : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,21 +76,21 @@ public static TemplateCreateEmbeddedDraftResponseTemplate Init(string jsonData) /// The id of the Template. [DataMember(Name = "template_id", EmitDefaultValue = true)] public string TemplateId { get; set; } - + /// /// Link to edit the template. /// /// Link to edit the template. [DataMember(Name = "edit_url", EmitDefaultValue = true)] public string EditUrl { get; set; } - + /// /// When the link expires. /// /// When the link expires. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int ExpiresAt { get; set; } - + /// /// A list of warnings. /// @@ -98,7 +98,7 @@ public static TemplateCreateEmbeddedDraftResponseTemplate Init(string jsonData) [DataMember(Name = "warnings", EmitDefaultValue = true)] [Obsolete] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -194,6 +194,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -224,16 +233,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateCreateRequest.cs b/src/Dropbox.Sign/Model/TemplateCreateRequest.cs index 5c73188..424439e 100644 --- a/src/Dropbox.Sign/Model/TemplateCreateRequest.cs +++ b/src/Dropbox.Sign/Model/TemplateCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -114,125 +114,125 @@ public static TemplateCreateRequest Init(string jsonData) /// 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` [DataMember(Name = "form_fields_per_document", IsRequired = true, EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. [DataMember(Name = "signer_roles", IsRequired = true, EmitDefaultValue = true)] public List SignerRoles { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The CC roles that must be assigned when using the template to send a signature request /// /// The CC roles that must be assigned when using the template to send a signature request [DataMember(Name = "cc_roles", EmitDefaultValue = true)] public List CcRoles { get; set; } - + /// /// Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. /// /// Client id of the app you're using to create this draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "merge_fields", EmitDefaultValue = true)] public List MergeFields { get; set; } - + /// /// The default template email message. /// /// The default template email message. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// The template title (alias). /// /// The template title (alias). [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). /// /// Enable the detection of predefined PDF fields by setting the `use_preexisting_fields` to `true` (defaults to disabled, or `false`). [DataMember(Name = "use_preexisting_fields", EmitDefaultValue = true)] public bool UsePreexistingFields { get; set; } - + /// /// Returns the string presentation of the object /// @@ -469,6 +469,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 200) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -583,28 +604,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 200) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateCreateResponse.cs b/src/Dropbox.Sign/Model/TemplateCreateResponse.cs index a342dd9..93f8983 100644 --- a/src/Dropbox.Sign/Model/TemplateCreateResponse.cs +++ b/src/Dropbox.Sign/Model/TemplateCreateResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TemplateCreateResponse() { } /// /// Initializes a new instance of the class. /// - /// template. + /// template (required). /// A list of warnings.. public TemplateCreateResponse(TemplateCreateResponseTemplate template = default(TemplateCreateResponseTemplate), List warnings = default(List)) { + // to ensure "template" is required (not null) + if (template == null) + { + throw new ArgumentNullException("template is a required property for TemplateCreateResponse and cannot be null"); + } this.Template = template; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static TemplateCreateResponse Init(string jsonData) /// /// Gets or Sets Template /// - [DataMember(Name = "template", EmitDefaultValue = true)] + [DataMember(Name = "template", IsRequired = true, EmitDefaultValue = true)] public TemplateCreateResponseTemplate Template { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateCreateResponseTemplate.cs b/src/Dropbox.Sign/Model/TemplateCreateResponseTemplate.cs index 32b22c9..2ba366d 100644 --- a/src/Dropbox.Sign/Model/TemplateCreateResponseTemplate.cs +++ b/src/Dropbox.Sign/Model/TemplateCreateResponseTemplate.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateCreateResponseTemplate")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateCreateResponseTemplate : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateCreateResponseTemplate : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static TemplateCreateResponseTemplate Init(string jsonData) /// The id of the Template. [DataMember(Name = "template_id", EmitDefaultValue = true)] public string TemplateId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +139,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -151,16 +160,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateEditResponse.cs b/src/Dropbox.Sign/Model/TemplateEditResponse.cs index c885a95..ee5f658 100644 --- a/src/Dropbox.Sign/Model/TemplateEditResponse.cs +++ b/src/Dropbox.Sign/Model/TemplateEditResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateEditResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateEditResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateEditResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,10 +41,15 @@ protected TemplateEditResponse() { } /// /// Initializes a new instance of the class. /// - /// The id of the Template.. + /// The id of the Template. (required). public TemplateEditResponse(string templateId = default(string)) { + // to ensure "templateId" is required (not null) + if (templateId == null) + { + throw new ArgumentNullException("templateId is a required property for TemplateEditResponse and cannot be null"); + } this.TemplateId = templateId; } @@ -68,9 +73,9 @@ public static TemplateEditResponse Init(string jsonData) /// The id of the Template. /// /// The id of the Template. - [DataMember(Name = "template_id", EmitDefaultValue = true)] + [DataMember(Name = "template_id", IsRequired = true, EmitDefaultValue = true)] public string TemplateId { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +144,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -151,16 +165,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateGetResponse.cs b/src/Dropbox.Sign/Model/TemplateGetResponse.cs index 7e2f560..2ead886 100644 --- a/src/Dropbox.Sign/Model/TemplateGetResponse.cs +++ b/src/Dropbox.Sign/Model/TemplateGetResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateGetResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateGetResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateGetResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected TemplateGetResponse() { } /// /// Initializes a new instance of the class. /// - /// template. + /// template (required). /// A list of warnings.. public TemplateGetResponse(TemplateResponse template = default(TemplateResponse), List warnings = default(List)) { + // to ensure "template" is required (not null) + if (template == null) + { + throw new ArgumentNullException("template is a required property for TemplateGetResponse and cannot be null"); + } this.Template = template; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static TemplateGetResponse Init(string jsonData) /// /// Gets or Sets Template /// - [DataMember(Name = "template", EmitDefaultValue = true)] + [DataMember(Name = "template", IsRequired = true, EmitDefaultValue = true)] public TemplateResponse Template { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateListResponse.cs b/src/Dropbox.Sign/Model/TemplateListResponse.cs index 654a2e0..9c20b3d 100644 --- a/src/Dropbox.Sign/Model/TemplateListResponse.cs +++ b/src/Dropbox.Sign/Model/TemplateListResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateListResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateListResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateListResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,13 +41,23 @@ protected TemplateListResponse() { } /// /// Initializes a new instance of the class. /// - /// List of templates that the API caller has access to.. - /// listInfo. + /// List of templates that the API caller has access to. (required). + /// listInfo (required). /// A list of warnings.. public TemplateListResponse(List templates = default(List), ListInfoResponse listInfo = default(ListInfoResponse), List warnings = default(List)) { + // to ensure "templates" is required (not null) + if (templates == null) + { + throw new ArgumentNullException("templates is a required property for TemplateListResponse and cannot be null"); + } this.Templates = templates; + // to ensure "listInfo" is required (not null) + if (listInfo == null) + { + throw new ArgumentNullException("listInfo is a required property for TemplateListResponse and cannot be null"); + } this.ListInfo = listInfo; this.Warnings = warnings; } @@ -72,22 +82,22 @@ public static TemplateListResponse Init(string jsonData) /// List of templates that the API caller has access to. /// /// List of templates that the API caller has access to. - [DataMember(Name = "templates", EmitDefaultValue = true)] + [DataMember(Name = "templates", IsRequired = true, EmitDefaultValue = true)] public List Templates { get; set; } - + /// /// Gets or Sets ListInfo /// - [DataMember(Name = "list_info", EmitDefaultValue = true)] + [DataMember(Name = "list_info", IsRequired = true, EmitDefaultValue = true)] public ListInfoResponse ListInfo { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -178,6 +188,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -202,16 +221,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateRemoveUserRequest.cs b/src/Dropbox.Sign/Model/TemplateRemoveUserRequest.cs index 2676f0a..69e9fcf 100644 --- a/src/Dropbox.Sign/Model/TemplateRemoveUserRequest.cs +++ b/src/Dropbox.Sign/Model/TemplateRemoveUserRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateRemoveUserRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateRemoveUserRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateRemoveUserRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static TemplateRemoveUserRequest Init(string jsonData) /// The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. /// /// The id or email address of the Account to remove access to the Template. The account id prevails if both are provided. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponse.cs b/src/Dropbox.Sign/Model/TemplateResponse.cs index 4037176..db054a3 100644 --- a/src/Dropbox.Sign/Model/TemplateResponse.cs +++ b/src/Dropbox.Sign/Model/TemplateResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -98,84 +98,84 @@ public static TemplateResponse Init(string jsonData) /// The id of the Template. [DataMember(Name = "template_id", EmitDefaultValue = true)] public string TemplateId { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// Time the template was last updated. /// /// Time the template was last updated. [DataMember(Name = "updated_at", EmitDefaultValue = true)] public int UpdatedAt { get; set; } - + /// /// `true` if this template was created using an embedded flow, `false` if it was created on our website. /// /// `true` if this template was created using an embedded flow, `false` if it was created on our website. [DataMember(Name = "is_embedded", EmitDefaultValue = true)] public bool? IsEmbedded { get; set; } - + /// /// `true` if you are the owner of this template, `false` if it's been shared with you by a team member. /// /// `true` if you are the owner of this template, `false` if it's been shared with you by a team member. [DataMember(Name = "is_creator", EmitDefaultValue = true)] public bool? IsCreator { get; set; } - + /// /// Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). /// /// Indicates whether edit rights have been granted to you by the owner (always `true` if that's you). [DataMember(Name = "can_edit", EmitDefaultValue = true)] public bool? CanEdit { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "is_locked", EmitDefaultValue = true)] public bool? IsLocked { get; set; } - + /// /// The metadata attached to the template. /// /// The metadata attached to the template. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Object Metadata { get; set; } - + /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. /// /// An array of the designated signer roles that must be specified when sending a SignatureRequest using this Template. [DataMember(Name = "signer_roles", EmitDefaultValue = true)] public List SignerRoles { get; set; } - + /// /// An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. /// /// An array of the designated CC roles that must be specified when sending a SignatureRequest using this Template. [DataMember(Name = "cc_roles", EmitDefaultValue = true)] public List CcRoles { get; set; } - + /// /// An array describing each document associated with this Template. Includes form field data for each document. /// /// An array describing each document associated with this Template. Includes form field data for each document. [DataMember(Name = "documents", EmitDefaultValue = true)] public List Documents { get; set; } - + /// /// Deprecated. Use `custom_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. /// @@ -183,7 +183,7 @@ public static TemplateResponse Init(string jsonData) [DataMember(Name = "custom_fields", EmitDefaultValue = true)] [Obsolete] public List CustomFields { get; set; } - + /// /// Deprecated. Use `form_fields` inside the [documents](https://developers.hellosign.com/api/reference/operation/templateGet/#!c=200&path=template/documents&t=response) array instead. /// @@ -191,14 +191,14 @@ public static TemplateResponse Init(string jsonData) [DataMember(Name = "named_form_fields", EmitDefaultValue = true)] [Obsolete] public List NamedFormFields { get; set; } - + /// /// An array of the Accounts that can use this Template. /// /// An array of the Accounts that can use this Template. [DataMember(Name = "accounts", EmitDefaultValue = true)] public List Accounts { get; set; } - + /// /// Returns the string presentation of the object /// @@ -409,6 +409,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -505,16 +514,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseAccount.cs b/src/Dropbox.Sign/Model/TemplateResponseAccount.cs index 5bcaa37..315b8a5 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseAccount.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseAccount.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseAccount")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseAccount : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseAccount : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,41 +80,41 @@ public static TemplateResponseAccount Init(string jsonData) /// The id of the Account. [DataMember(Name = "account_id", EmitDefaultValue = true)] public string AccountId { get; set; } - + /// /// The email address associated with the Account. /// /// The email address associated with the Account. [DataMember(Name = "email_address", EmitDefaultValue = true)] public string EmailAddress { get; set; } - + /// /// Returns `true` if the user has been locked out of their account by a team admin. /// /// Returns `true` if the user has been locked out of their account by a team admin. [DataMember(Name = "is_locked", EmitDefaultValue = true)] public bool IsLocked { get; set; } - + /// /// Returns `true` if the user has a paid Dropbox Sign account. /// /// Returns `true` if the user has a paid Dropbox Sign account. [DataMember(Name = "is_paid_hs", EmitDefaultValue = true)] public bool IsPaidHs { get; set; } - + /// /// Returns `true` if the user has a paid HelloFax account. /// /// Returns `true` if the user has a paid HelloFax account. [DataMember(Name = "is_paid_hf", EmitDefaultValue = true)] public bool IsPaidHf { get; set; } - + /// /// Gets or Sets Quotas /// [DataMember(Name = "quotas", EmitDefaultValue = true)] public TemplateResponseAccountQuota Quotas { get; set; } - + /// /// Returns the string presentation of the object /// @@ -221,6 +221,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -263,16 +272,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseAccountQuota.cs b/src/Dropbox.Sign/Model/TemplateResponseAccountQuota.cs index 6341197..9ed9b17 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseAccountQuota.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseAccountQuota.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseAccountQuota")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseAccountQuota : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseAccountQuota : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -76,28 +76,28 @@ public static TemplateResponseAccountQuota Init(string jsonData) /// API templates remaining. [DataMember(Name = "templates_left", EmitDefaultValue = true)] public int TemplatesLeft { get; set; } - + /// /// API signature requests remaining. /// /// API signature requests remaining. [DataMember(Name = "api_signature_requests_left", EmitDefaultValue = true)] public int ApiSignatureRequestsLeft { get; set; } - + /// /// Signature requests remaining. /// /// Signature requests remaining. [DataMember(Name = "documents_left", EmitDefaultValue = true)] public int DocumentsLeft { get; set; } - + /// /// SMS verifications remaining. /// /// SMS verifications remaining. [DataMember(Name = "sms_verifications_left", EmitDefaultValue = true)] public int SmsVerificationsLeft { get; set; } - + /// /// Returns the string presentation of the object /// @@ -180,6 +180,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -210,16 +219,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseCCRole.cs b/src/Dropbox.Sign/Model/TemplateResponseCCRole.cs index 6692584..7cb5bf5 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseCCRole.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseCCRole.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseCCRole")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseCCRole : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseCCRole : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -70,7 +70,7 @@ public static TemplateResponseCCRole Init(string jsonData) /// The name of the Role. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Returns the string presentation of the object /// @@ -139,6 +139,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -151,16 +160,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocument.cs b/src/Dropbox.Sign/Model/TemplateResponseDocument.cs index 03dc748..38d7743 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocument.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocument.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocument")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocument : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocument : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,42 +80,42 @@ public static TemplateResponseDocument Init(string jsonData) /// Name of the associated file. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Document ordering, the lowest index is displayed first and the highest last (0-based indexing). /// /// Document ordering, the lowest index is displayed first and the highest last (0-based indexing). [DataMember(Name = "index", EmitDefaultValue = true)] public int Index { get; set; } - + /// /// An array of Form Field Group objects. /// /// An array of Form Field Group objects. [DataMember(Name = "field_groups", EmitDefaultValue = true)] public List FieldGroups { get; set; } - + /// /// An array of Form Field objects containing the name and type of each named field. /// /// An array of Form Field objects containing the name and type of each named field. [DataMember(Name = "form_fields", EmitDefaultValue = true)] public List FormFields { get; set; } - + /// /// An array of Form Field objects containing the name and type of each named field. /// /// An array of Form Field objects containing the name and type of each named field. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. /// /// An array describing static overlay fields. **NOTE:** Only available for certain subscriptions. [DataMember(Name = "static_fields", EmitDefaultValue = true)] public List StaticFields { get; set; } - + /// /// Returns the string presentation of the object /// @@ -234,6 +234,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -276,16 +285,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldBase.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldBase.cs index 1ed5b4f..c952de1 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldBase.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldBase.cs @@ -32,12 +32,10 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocumentCustomFieldBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldCheckbox), "TemplateResponseDocumentCustomFieldCheckbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldText), "TemplateResponseDocumentCustomFieldText")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocumentCustomFieldBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocumentCustomFieldBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -57,7 +55,7 @@ protected TemplateResponseDocumentCustomFieldBase() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentCustomFieldBase(string apiId = default(string), string name = default(string), string type = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentCustomFieldBase(string apiId = default(string), string name = default(string), string type = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { // to ensure "type" is required (not null) @@ -68,7 +66,7 @@ protected TemplateResponseDocumentCustomFieldBase() { } this.Type = type; this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -98,70 +96,74 @@ public static TemplateResponseDocumentCustomFieldBase Init(string jsonData) /// [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// The unique ID for this field. /// /// The unique ID for this field. [DataMember(Name = "api_id", EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// The name of the Custom Field. /// /// The name of the Custom Field. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). /// /// The signer of the Custom Field. Can be `null` if field is a merge field (assigned to Sender). [DataMember(Name = "signer", EmitDefaultValue = true)] - public string Signer { get; set; } + public object Signer { + get => this._signer; + set => this._signer = Convert.ToString(value); + } + private string _signer; /// /// The horizontal offset in pixels for this form field. /// /// The horizontal offset in pixels for this form field. [DataMember(Name = "x", EmitDefaultValue = true)] public int X { get; set; } - + /// /// The vertical offset in pixels for this form field. /// /// The vertical offset in pixels for this form field. [DataMember(Name = "y", EmitDefaultValue = true)] public int Y { get; set; } - + /// /// The width in pixels of this form field. /// /// The width in pixels of this form field. [DataMember(Name = "width", EmitDefaultValue = true)] public int Width { get; set; } - + /// /// The height in pixels of this form field. /// /// The height in pixels of this form field. [DataMember(Name = "height", EmitDefaultValue = true)] public int Height { get; set; } - + /// /// Boolean showing whether or not this field is required. /// /// Boolean showing whether or not this field is required. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// The name of the group this field is in. If this field is not a group, this defaults to `null`. /// /// The name of the group this field is in. If this field is not a group, this defaults to `null`. [DataMember(Name = "group", EmitDefaultValue = true)] public string Group { get; set; } - + /// /// Returns the string presentation of the object /// @@ -300,6 +302,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -366,26 +387,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldCheckbox.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldCheckbox.cs index 309d29a..7ab6621 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldCheckbox.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,9 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentCustomFieldBase` /// [DataContract(Name = "TemplateResponseDocumentCustomFieldCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentCustomFieldCheckbox : TemplateResponseDocumentCustomFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -55,11 +51,11 @@ protected TemplateResponseDocumentCustomFieldCheckbox() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentCustomFieldCheckbox(string type = "checkbox", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentCustomFieldCheckbox(string type = @"checkbox", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -97,7 +93,7 @@ public static TemplateResponseDocumentCustomFieldCheckbox Init(string jsonData) /// The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -167,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -195,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -203,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldText.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldText.cs index c07f639..8ac152e 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldText.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentCustomFieldText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,9 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentCustomFieldBase` /// [DataContract(Name = "TemplateResponseDocumentCustomFieldText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentCustomFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentCustomFieldText : TemplateResponseDocumentCustomFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -59,11 +55,11 @@ protected TemplateResponseDocumentCustomFieldText() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentCustomFieldText(string type = "text", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentCustomFieldText(string type = @"text", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -105,34 +101,34 @@ public static TemplateResponseDocumentCustomFieldText Init(string jsonData) /// The type of this Custom Field. Only `text` and `checkbox` are currently supported. * Text uses `TemplateResponseDocumentCustomFieldText` * Checkbox uses `TemplateResponseDocumentCustomFieldCheckbox` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Gets or Sets AvgTextLength /// [DataMember(Name = "avg_text_length", EmitDefaultValue = true)] public TemplateResponseFieldAvgTextLength AvgTextLength { get; set; } - + /// /// Whether this form field is multiline text. /// /// Whether this form field is multiline text. [DataMember(Name = "isMultiline", EmitDefaultValue = true)] public bool IsMultiline { get; set; } - + /// /// Original font size used in this form field's text. /// /// Original font size used in this form field's text. [DataMember(Name = "originalFontSize", EmitDefaultValue = true)] public int OriginalFontSize { get; set; } - + /// /// Font family used in this form field's text. /// /// Font family used in this form field's text. [DataMember(Name = "fontFamily", EmitDefaultValue = true)] public string FontFamily { get; set; } - + /// /// Returns the string presentation of the object /// @@ -234,6 +230,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -270,30 +289,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroup.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroup.cs index d8f5964..63d9fa6 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroup.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroup.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocumentFieldGroup")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocumentFieldGroup : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocumentFieldGroup : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,13 +72,13 @@ public static TemplateResponseDocumentFieldGroup Init(string jsonData) /// The name of the form field group. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// Gets or Sets Rule /// [DataMember(Name = "rule", EmitDefaultValue = true)] public TemplateResponseDocumentFieldGroupRule Rule { get; set; } - + /// /// Returns the string presentation of the object /// @@ -157,6 +157,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -175,16 +184,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroupRule.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroupRule.cs index 667be62..68a46ff 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroupRule.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentFieldGroupRule.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocumentFieldGroupRule")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocumentFieldGroupRule : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocumentFieldGroupRule : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static TemplateResponseDocumentFieldGroupRule Init(string jsonData) /// 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. [DataMember(Name = "requirement", EmitDefaultValue = true)] public string Requirement { get; set; } - + /// /// Name of the group /// /// Name of the group [DataMember(Name = "groupLabel", EmitDefaultValue = true)] public string GroupLabel { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +158,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +185,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldBase.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldBase.cs index e14e87f..f8ce1a2 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldBase.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldBase.cs @@ -32,14 +32,6 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocumentFormFieldBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "TemplateResponseDocumentFormFieldCheckbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "TemplateResponseDocumentFormFieldDateSigned")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "TemplateResponseDocumentFormFieldDropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "TemplateResponseDocumentFormFieldHyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "TemplateResponseDocumentFormFieldInitials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "TemplateResponseDocumentFormFieldRadio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "TemplateResponseDocumentFormFieldSignature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "TemplateResponseDocumentFormFieldText")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] @@ -49,7 +41,7 @@ namespace Dropbox.Sign.Model [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocumentFormFieldBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocumentFormFieldBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -69,7 +61,7 @@ protected TemplateResponseDocumentFormFieldBase() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldBase(string apiId = default(string), string name = default(string), string type = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldBase(string apiId = default(string), string name = default(string), string type = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { // to ensure "type" is required (not null) @@ -80,7 +72,7 @@ protected TemplateResponseDocumentFormFieldBase() { } this.Type = type; this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -110,70 +102,74 @@ public static TemplateResponseDocumentFormFieldBase Init(string jsonData) /// [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// A unique id for the form field. /// /// A unique id for the form field. [DataMember(Name = "api_id", EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// The name of the form field. /// /// The name of the form field. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The signer of the Form Field. /// /// The signer of the Form Field. [DataMember(Name = "signer", EmitDefaultValue = true)] - public string Signer { get; set; } + public object Signer { + get => this._signer; + set => this._signer = Convert.ToString(value); + } + private string _signer; /// /// The horizontal offset in pixels for this form field. /// /// The horizontal offset in pixels for this form field. [DataMember(Name = "x", EmitDefaultValue = true)] public int X { get; set; } - + /// /// The vertical offset in pixels for this form field. /// /// The vertical offset in pixels for this form field. [DataMember(Name = "y", EmitDefaultValue = true)] public int Y { get; set; } - + /// /// The width in pixels of this form field. /// /// The width in pixels of this form field. [DataMember(Name = "width", EmitDefaultValue = true)] public int Width { get; set; } - + /// /// The height in pixels of this form field. /// /// The height in pixels of this form field. [DataMember(Name = "height", EmitDefaultValue = true)] public int Height { get; set; } - + /// /// Boolean showing whether or not this field is required. /// /// Boolean showing whether or not this field is required. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. /// /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. [DataMember(Name = "group", EmitDefaultValue = true)] public string Group { get; set; } - + /// /// Returns the string presentation of the object /// @@ -312,6 +308,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -378,26 +393,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldCheckbox.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldCheckbox.cs index 8ebf880..360c160 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldCheckbox.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldCheckbox : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldCheckbox() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldCheckbox(string type = "checkbox", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldCheckbox(string type = @"checkbox", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldCheckbox Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDateSigned.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDateSigned.cs index 55fe076..54eeb6d 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDateSigned.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDateSigned.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldDateSigned")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldDateSigned : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldDateSigned() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldDateSigned(string type = "date_signed", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldDateSigned(string type = @"date_signed", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldDateSigned Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDropdown.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDropdown.cs index e39b48a..737adb5 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDropdown.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldDropdown.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldDropdown")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldDropdown : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldDropdown() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldDropdown(string type = "dropdown", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldDropdown(string type = @"dropdown", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldDropdown Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldHyperlink.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldHyperlink.cs index fe74f8e..3c6c4ad 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldHyperlink.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldHyperlink.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldHyperlink")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldHyperlink : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -65,11 +55,11 @@ protected TemplateResponseDocumentFormFieldHyperlink() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldHyperlink(string type = "hyperlink", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldHyperlink(string type = @"hyperlink", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -111,34 +101,34 @@ public static TemplateResponseDocumentFormFieldHyperlink Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Gets or Sets AvgTextLength /// [DataMember(Name = "avg_text_length", EmitDefaultValue = true)] public TemplateResponseFieldAvgTextLength AvgTextLength { get; set; } - + /// /// Whether this form field is multiline text. /// /// Whether this form field is multiline text. [DataMember(Name = "isMultiline", EmitDefaultValue = true)] public bool IsMultiline { get; set; } - + /// /// Original font size used in this form field's text. /// /// Original font size used in this form field's text. [DataMember(Name = "originalFontSize", EmitDefaultValue = true)] public int OriginalFontSize { get; set; } - + /// /// Font family used in this form field's text. /// /// Font family used in this form field's text. [DataMember(Name = "fontFamily", EmitDefaultValue = true)] public string FontFamily { get; set; } - + /// /// Returns the string presentation of the object /// @@ -240,6 +230,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -276,30 +289,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldInitials.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldInitials.cs index df5838d..3d7328b 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldInitials.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldInitials.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldInitials")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldInitials : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldInitials() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldInitials(string type = "initials", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldInitials(string type = @"initials", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldInitials Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldRadio.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldRadio.cs index 62cb44f..cc3c00a 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldRadio.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldRadio.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldRadio")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldRadio : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldRadio() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. (required). - public TemplateResponseDocumentFormFieldRadio(string type = "radio", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldRadio(string type = @"radio", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldRadio Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldSignature.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldSignature.cs index 98b3358..39e0edf 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldSignature.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldSignature.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldSignature")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldSignature : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,11 +51,11 @@ protected TemplateResponseDocumentFormFieldSignature() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldSignature(string type = "signature", string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldSignature(string type = @"signature", string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentFormFieldSignature Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldText.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldText.cs index d81fc31..31538b4 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldText.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentFormFieldText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentFormFieldBase` /// [DataContract(Name = "TemplateResponseDocumentFormFieldText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentFormFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentFormFieldText : TemplateResponseDocumentFormFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -109,7 +99,6 @@ public enum ValidationTypeEnum /// [EnumMember(Value = "custom_regex")] CustomRegex = 10 - } @@ -142,11 +131,11 @@ protected TemplateResponseDocumentFormFieldText() { } /// The height in pixels of this form field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.. - public TemplateResponseDocumentFormFieldText(string type = "text", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), ValidationTypeEnum? validationType = default(ValidationTypeEnum?), string apiId = default(string), string name = default(string), string signer = default(string), int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentFormFieldText(string type = @"text", TemplateResponseFieldAvgTextLength avgTextLength = default(TemplateResponseFieldAvgTextLength), bool isMultiline = default(bool), int originalFontSize = default(int), string fontFamily = default(string), ValidationTypeEnum? validationType = default(ValidationTypeEnum?), string apiId = default(string), string name = default(string), Object signer = null, int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; - this.Signer = signer; + this.Signer = Convert.ToString(signer); this.X = x; this.Y = y; this.Width = width; @@ -189,34 +178,34 @@ public static TemplateResponseDocumentFormFieldText Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Gets or Sets AvgTextLength /// [DataMember(Name = "avg_text_length", EmitDefaultValue = true)] public TemplateResponseFieldAvgTextLength AvgTextLength { get; set; } - + /// /// Whether this form field is multiline text. /// /// Whether this form field is multiline text. [DataMember(Name = "isMultiline", EmitDefaultValue = true)] public bool IsMultiline { get; set; } - + /// /// Original font size used in this form field's text. /// /// Original font size used in this form field's text. [DataMember(Name = "originalFontSize", EmitDefaultValue = true)] public int OriginalFontSize { get; set; } - + /// /// Font family used in this form field's text. /// /// Font family used in this form field's text. [DataMember(Name = "fontFamily", EmitDefaultValue = true)] public string FontFamily { get; set; } - + /// /// Returns the string presentation of the object /// @@ -324,6 +313,29 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -366,30 +378,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - foreach (var x in BaseValidate(validationContext)) - { - yield return x; - } - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldBase.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldBase.cs index 9335960..4d663c7 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldBase.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldBase.cs @@ -32,14 +32,6 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseDocumentStaticFieldBase")] [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "TemplateResponseDocumentStaticFieldCheckbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "TemplateResponseDocumentStaticFieldDateSigned")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "TemplateResponseDocumentStaticFieldDropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "TemplateResponseDocumentStaticFieldHyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "TemplateResponseDocumentStaticFieldInitials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "TemplateResponseDocumentStaticFieldRadio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "TemplateResponseDocumentStaticFieldSignature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "TemplateResponseDocumentStaticFieldText")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] @@ -49,7 +41,7 @@ namespace Dropbox.Sign.Model [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseDocumentStaticFieldBase : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseDocumentStaticFieldBase : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -69,7 +61,7 @@ protected TemplateResponseDocumentStaticFieldBase() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldBase(string apiId = default(string), string name = default(string), string type = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldBase(string apiId = default(string), string name = default(string), string type = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { // to ensure "type" is required (not null) @@ -111,70 +103,70 @@ public static TemplateResponseDocumentStaticFieldBase Init(string jsonData) /// [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// A unique id for the static field. /// /// A unique id for the static field. [DataMember(Name = "api_id", EmitDefaultValue = true)] public string ApiId { get; set; } - + /// /// The name of the static field. /// /// The name of the static field. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// The signer of the Static Field. /// /// The signer of the Static Field. [DataMember(Name = "signer", EmitDefaultValue = true)] public string Signer { get; set; } - + /// /// The horizontal offset in pixels for this static field. /// /// The horizontal offset in pixels for this static field. [DataMember(Name = "x", EmitDefaultValue = true)] public int X { get; set; } - + /// /// The vertical offset in pixels for this static field. /// /// The vertical offset in pixels for this static field. [DataMember(Name = "y", EmitDefaultValue = true)] public int Y { get; set; } - + /// /// The width in pixels of this static field. /// /// The width in pixels of this static field. [DataMember(Name = "width", EmitDefaultValue = true)] public int Width { get; set; } - + /// /// The height in pixels of this static field. /// /// The height in pixels of this static field. [DataMember(Name = "height", EmitDefaultValue = true)] public int Height { get; set; } - + /// /// Boolean showing whether or not this field is required. /// /// Boolean showing whether or not this field is required. [DataMember(Name = "required", EmitDefaultValue = true)] public bool Required { get; set; } - + /// /// The name of the group this field is in. If this field is not a group, this defaults to `null`. /// /// The name of the group this field is in. If this field is not a group, this defaults to `null`. [DataMember(Name = "group", EmitDefaultValue = true)] public string Group { get; set; } - + /// /// Returns the string presentation of the object /// @@ -313,6 +305,25 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -379,26 +390,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - return this.BaseValidate(validationContext); - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldCheckbox.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldCheckbox.cs index e4618ec..fec41a9 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldCheckbox.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldCheckbox.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldCheckbox")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldCheckbox : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldCheckbox() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldCheckbox(string type = "checkbox", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldCheckbox(string type = @"checkbox", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldCheckbox Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDateSigned.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDateSigned.cs index 805b11b..e029aa8 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDateSigned.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDateSigned.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldDateSigned")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldDateSigned : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldDateSigned() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldDateSigned(string type = "date_signed", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldDateSigned(string type = @"date_signed", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldDateSigned Init(string jsonData /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDropdown.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDropdown.cs index 61c3c21..ce159eb 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDropdown.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldDropdown.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldDropdown")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldDropdown : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldDropdown() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldDropdown(string type = "dropdown", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldDropdown(string type = @"dropdown", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldDropdown Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldHyperlink.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldHyperlink.cs index a149928..c27885a 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldHyperlink.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldHyperlink.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldHyperlink")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldHyperlink : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldHyperlink() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldHyperlink(string type = "hyperlink", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldHyperlink(string type = @"hyperlink", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldHyperlink Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldInitials.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldInitials.cs index 6033d3a..d4caf27 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldInitials.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldInitials.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldInitials")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldInitials : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldInitials() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldInitials(string type = "initials", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldInitials(string type = @"initials", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldInitials Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldRadio.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldRadio.cs index 8e783bf..365b450 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldRadio.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldRadio.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldRadio")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldRadio : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldRadio() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldRadio(string type = "radio", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldRadio(string type = @"radio", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldRadio Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldSignature.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldSignature.cs index 07f4b39..50744be 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldSignature.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldSignature.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldSignature")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldSignature : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldSignature() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldSignature(string type = "signature", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldSignature(string type = @"signature", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldSignature Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldText.cs b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldText.cs index 292dc61..69695eb 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldText.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseDocumentStaticFieldText.cs @@ -21,7 +21,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Dropbox.Sign.Client.OpenAPIDateConverter; @@ -31,15 +30,6 @@ namespace Dropbox.Sign.Model /// This class extends `TemplateResponseDocumentStaticFieldBase` /// [DataContract(Name = "TemplateResponseDocumentStaticFieldText")] - [JsonConverter(typeof(JsonSubtypes), "Type")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldCheckbox), "checkbox")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDateSigned), "date_signed")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldDropdown), "dropdown")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldHyperlink), "hyperlink")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldInitials), "initials")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldRadio), "radio")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldSignature), "signature")] - [JsonSubtypes.KnownSubType(typeof(TemplateResponseDocumentStaticFieldText), "text")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public partial class TemplateResponseDocumentStaticFieldText : TemplateResponseDocumentStaticFieldBase, IOpenApiTyped, IEquatable, IValidatableObject { @@ -61,7 +51,7 @@ protected TemplateResponseDocumentStaticFieldText() { } /// The height in pixels of this static field.. /// Boolean showing whether or not this field is required.. /// The name of the group this field is in. If this field is not a group, this defaults to `null`.. - public TemplateResponseDocumentStaticFieldText(string type = "text", string apiId = default(string), string name = default(string), string signer = "me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) + public TemplateResponseDocumentStaticFieldText(string type = @"text", string apiId = default(string), string name = default(string), string signer = @"me_now", int x = default(int), int y = default(int), int width = default(int), int height = default(int), bool required = default(bool), string group = default(string)) { this.ApiId = apiId; this.Name = name; @@ -103,7 +93,7 @@ public static TemplateResponseDocumentStaticFieldText Init(string jsonData) /// 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` [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] public string Type { get; set; } - + /// /// Returns the string presentation of the object /// @@ -173,25 +163,12 @@ public override int GetHashCode() } } - public List GetOpenApiTypes() - { - var types = new List(); - types.Add(new OpenApiType(){ - Name = "type", - Property = "Type", - Type = "string", - Value = Type, - }); - - return types; - } - /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -201,7 +178,7 @@ public List GetOpenApiTypes() /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach (var x in BaseValidate(validationContext)) { @@ -209,6 +186,18 @@ public List GetOpenApiTypes() } yield break; } + public List GetOpenApiTypes() + { + var types = new List(); + types.Add(new OpenApiType(){ + Name = "type", + Property = "Type", + Type = "string", + Value = Type, + }); + + return types; + } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseFieldAvgTextLength.cs b/src/Dropbox.Sign/Model/TemplateResponseFieldAvgTextLength.cs index 653edf3..bebe8a6 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseFieldAvgTextLength.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseFieldAvgTextLength.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseFieldAvgTextLength")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseFieldAvgTextLength : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseFieldAvgTextLength : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static TemplateResponseFieldAvgTextLength Init(string jsonData) /// Number of lines. [DataMember(Name = "num_lines", EmitDefaultValue = true)] public int NumLines { get; set; } - + /// /// Number of characters per line. /// /// Number of characters per line. [DataMember(Name = "num_chars_per_line", EmitDefaultValue = true)] public int NumCharsPerLine { get; set; } - + /// /// Returns the string presentation of the object /// @@ -150,6 +150,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -168,16 +177,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateResponseSignerRole.cs b/src/Dropbox.Sign/Model/TemplateResponseSignerRole.cs index 03bdca7..d7b0438 100644 --- a/src/Dropbox.Sign/Model/TemplateResponseSignerRole.cs +++ b/src/Dropbox.Sign/Model/TemplateResponseSignerRole.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateResponseSignerRole")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateResponseSignerRole : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateResponseSignerRole : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,14 +72,14 @@ public static TemplateResponseSignerRole Init(string jsonData) /// The name of the Role. [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } - + /// /// If signer order is assigned this is the 0-based index for this role. /// /// If signer order is assigned this is the 0-based index for this role. [DataMember(Name = "order", EmitDefaultValue = true)] public int Order { get; set; } - + /// /// Returns the string presentation of the object /// @@ -154,6 +154,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -172,16 +181,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateUpdateFilesRequest.cs b/src/Dropbox.Sign/Model/TemplateUpdateFilesRequest.cs index 8ac2ed5..c32ef2c 100644 --- a/src/Dropbox.Sign/Model/TemplateUpdateFilesRequest.cs +++ b/src/Dropbox.Sign/Model/TemplateUpdateFilesRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateUpdateFilesRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateUpdateFilesRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateUpdateFilesRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,42 +80,42 @@ public static TemplateUpdateFilesRequest Init(string jsonData) /// Client id of the app you're using to update this template. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to use for the template. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// The new default template email message. /// /// The new default template email message. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// The new default template email subject. /// /// The new default template email subject. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// Returns the string presentation of the object /// @@ -232,6 +232,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 100) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 100.", new [] { "Subject" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -274,28 +295,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 100) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 100.", new [] { "Subject" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateUpdateFilesResponse.cs b/src/Dropbox.Sign/Model/TemplateUpdateFilesResponse.cs index 09a1cd7..4c2fe85 100644 --- a/src/Dropbox.Sign/Model/TemplateUpdateFilesResponse.cs +++ b/src/Dropbox.Sign/Model/TemplateUpdateFilesResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateUpdateFilesResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateUpdateFilesResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateUpdateFilesResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,10 +41,15 @@ protected TemplateUpdateFilesResponse() { } /// /// Initializes a new instance of the class. /// - /// template. + /// template (required). public TemplateUpdateFilesResponse(TemplateUpdateFilesResponseTemplate template = default(TemplateUpdateFilesResponseTemplate)) { + // to ensure "template" is required (not null) + if (template == null) + { + throw new ArgumentNullException("template is a required property for TemplateUpdateFilesResponse and cannot be null"); + } this.Template = template; } @@ -67,9 +72,9 @@ public static TemplateUpdateFilesResponse Init(string jsonData) /// /// Gets or Sets Template /// - [DataMember(Name = "template", EmitDefaultValue = true)] + [DataMember(Name = "template", IsRequired = true, EmitDefaultValue = true)] public TemplateUpdateFilesResponseTemplate Template { get; set; } - + /// /// Returns the string presentation of the object /// @@ -138,6 +143,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -150,16 +164,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/TemplateUpdateFilesResponseTemplate.cs b/src/Dropbox.Sign/Model/TemplateUpdateFilesResponseTemplate.cs index 02babe5..4a04e8a 100644 --- a/src/Dropbox.Sign/Model/TemplateUpdateFilesResponseTemplate.cs +++ b/src/Dropbox.Sign/Model/TemplateUpdateFilesResponseTemplate.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "TemplateUpdateFilesResponseTemplate")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class TemplateUpdateFilesResponseTemplate : IOpenApiTyped, IEquatable, IValidatableObject + public partial class TemplateUpdateFilesResponseTemplate : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -72,7 +72,7 @@ public static TemplateUpdateFilesResponseTemplate Init(string jsonData) /// The id of the Template. [DataMember(Name = "template_id", EmitDefaultValue = true)] public string TemplateId { get; set; } - + /// /// A list of warnings. /// @@ -80,7 +80,7 @@ public static TemplateUpdateFilesResponseTemplate Init(string jsonData) [DataMember(Name = "warnings", EmitDefaultValue = true)] [Obsolete] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -160,6 +160,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -178,16 +187,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedRequest.cs b/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedRequest.cs index 688ca19..6b25115 100644 --- a/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedRequest.cs +++ b/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftCreateEmbeddedRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftCreateEmbeddedRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftCreateEmbeddedRequest : IEquatable, IValidatableObject { /// /// 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. @@ -51,7 +51,6 @@ public enum TypeEnum /// [EnumMember(Value = "request_signature")] RequestSignature = 2 - } @@ -178,242 +177,242 @@ public static UnclaimedDraftCreateEmbeddedRequest Init(string jsonData) /// Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. /// /// The email address of the user that should be designated as the requester of this draft, if the draft type is `request_signature`. [DataMember(Name = "requester_email_address", IsRequired = true, EmitDefaultValue = true)] public string RequesterEmailAddress { get; set; } - + /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. /// /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. [DataMember(Name = "allow_ccs", EmitDefaultValue = true)] public bool AllowCcs { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The email addresses that should be CCed. /// /// The email addresses that should be CCed. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Gets or Sets EditorOptions /// [DataMember(Name = "editor_options", EmitDefaultValue = true)] public SubEditorOptions EditorOptions { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// Provide users the ability to review/edit the signers. /// /// Provide users the ability to review/edit the signers. [DataMember(Name = "force_signer_page", EmitDefaultValue = true)] public bool ForceSignerPage { get; set; } - + /// /// Provide users the ability to review/edit the subject and message. /// /// Provide users the ability to review/edit the subject and message. [DataMember(Name = "force_subject_message", EmitDefaultValue = true)] public bool ForceSubjectMessage { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// 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` /// /// 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` [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] public bool HideTextTags { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "hold_request", EmitDefaultValue = true)] public bool HoldRequest { get; set; } - + /// /// The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. /// /// The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. [DataMember(Name = "is_for_embedded_signing", EmitDefaultValue = true)] public bool IsForEmbeddedSigning { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// The URL you want signers redirected to after they successfully request a signature. /// /// The URL you want signers redirected to after they successfully request a signature. [DataMember(Name = "requesting_redirect_url", EmitDefaultValue = true)] public string RequestingRedirectUrl { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "show_preview", EmitDefaultValue = true)] public bool ShowPreview { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// Add Signers to your Unclaimed Draft Signature Request. /// /// Add Signers to your Unclaimed Draft Signature Request. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. [DataMember(Name = "skip_me_now", EmitDefaultValue = true)] public bool SkipMeNow { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "use_preexisting_fields", EmitDefaultValue = true)] public bool UsePreexistingFields { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] public bool UseTextTags { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] public bool PopulateAutoFillFields { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -778,6 +777,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 200) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -1000,28 +1020,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 200) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.cs b/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.cs index b4a67c3..5f46598 100644 --- a/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.cs +++ b/src/Dropbox.Sign/Model/UnclaimedDraftCreateEmbeddedWithTemplateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftCreateEmbeddedWithTemplateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftCreateEmbeddedWithTemplateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftCreateEmbeddedWithTemplateRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -143,207 +143,207 @@ public static UnclaimedDraftCreateEmbeddedWithTemplateRequest Init(string jsonDa /// Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// The email address of the user that should be designated as the requester of this draft. /// /// The email address of the user that should be designated as the requester of this draft. [DataMember(Name = "requester_email_address", IsRequired = true, EmitDefaultValue = true)] public string RequesterEmailAddress { get; set; } - + /// /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. /// /// Use `template_ids` to create a SignatureRequest from one or more templates, in the order in which the templates will be used. [DataMember(Name = "template_ids", IsRequired = true, EmitDefaultValue = true)] public List TemplateIds { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "allow_reassign", EmitDefaultValue = true)] public bool AllowReassign { get; set; } - + /// /// Add CC email recipients. Required when a CC role exists for the Template. /// /// Add CC email recipients. Required when a CC role exists for the Template. [DataMember(Name = "ccs", EmitDefaultValue = true)] public List Ccs { get; set; } - + /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. /// /// An array defining values and options for custom fields. Required when a custom field exists in the Template. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Gets or Sets EditorOptions /// [DataMember(Name = "editor_options", EmitDefaultValue = true)] public SubEditorOptions EditorOptions { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// Provide users the ability to review/edit the template signer roles. /// /// Provide users the ability to review/edit the template signer roles. [DataMember(Name = "force_signer_roles", EmitDefaultValue = true)] public bool ForceSignerRoles { get; set; } - + /// /// Provide users the ability to review/edit the template subject and message. /// /// Provide users the ability to review/edit the template subject and message. [DataMember(Name = "force_subject_message", EmitDefaultValue = true)] public bool ForceSubjectMessage { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "hold_request", EmitDefaultValue = true)] public bool HoldRequest { get; set; } - + /// /// The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. /// /// The request created from this draft will also be signable in embedded mode if set to `true`. Defaults to `false`. [DataMember(Name = "is_for_embedded_signing", EmitDefaultValue = true)] public bool IsForEmbeddedSigning { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// 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). /// /// 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). [DataMember(Name = "preview_only", EmitDefaultValue = true)] public bool PreviewOnly { get; set; } - + /// /// The URL you want signers redirected to after they successfully request a signature. /// /// The URL you want signers redirected to after they successfully request a signature. [DataMember(Name = "requesting_redirect_url", EmitDefaultValue = true)] public string RequestingRedirectUrl { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "show_preview", EmitDefaultValue = true)] public bool ShowPreview { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// Add Signers to your Templated-based Signature Request. /// /// Add Signers to your Templated-based Signature Request. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. /// /// Disables the \"Me (Now)\" option for the person preparing the document. Does not work with type `send_document`. Defaults to `false`. [DataMember(Name = "skip_me_now", EmitDefaultValue = true)] public bool SkipMeNow { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// The title you want to assign to the SignatureRequest. /// /// The title you want to assign to the SignatureRequest. [DataMember(Name = "title", EmitDefaultValue = true)] public string Title { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "populate_auto_fill_fields", EmitDefaultValue = true)] public bool PopulateAutoFillFields { get; set; } - + /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. /// /// This allows the requester to specify whether the user is allowed to provide email addresses to CC when claiming the draft. [DataMember(Name = "allow_ccs", EmitDefaultValue = true)] public bool AllowCcs { get; set; } - + /// /// Returns the string presentation of the object /// @@ -657,6 +657,33 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 255) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); + } + + // Title (string) maxLength + if (this.Title != null && this.Title.Length > 255) + { + yield return new ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -843,34 +870,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 255.", new [] { "Subject" }); - } - - // Title (string) maxLength - if (this.Title != null && this.Title.Length > 255) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Title, length must be less than 255.", new [] { "Title" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/UnclaimedDraftCreateRequest.cs b/src/Dropbox.Sign/Model/UnclaimedDraftCreateRequest.cs index 21a0bbe..fd0e654 100644 --- a/src/Dropbox.Sign/Model/UnclaimedDraftCreateRequest.cs +++ b/src/Dropbox.Sign/Model/UnclaimedDraftCreateRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftCreateRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftCreateRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftCreateRequest : IEquatable, IValidatableObject { /// /// 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. @@ -51,7 +51,6 @@ public enum TypeEnum /// [EnumMember(Value = "request_signature")] RequestSignature = 2 - } @@ -144,159 +143,159 @@ public static UnclaimedDraftCreateRequest Init(string jsonData) /// Use `files[]` to indicate the uploaded file(s) to send for signature. This endpoint requires either **files** or **file_urls[]**, but not both. [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "file_urls", EmitDefaultValue = true)] public List FileUrls { get; set; } - + /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. /// /// Allows signers to decline to sign a document if `true`. Defaults to `false`. [DataMember(Name = "allow_decline", EmitDefaultValue = true)] public bool AllowDecline { get; set; } - + /// /// A list describing the attachments /// /// A list describing the attachments [DataMember(Name = "attachments", EmitDefaultValue = true)] public List Attachments { get; set; } - + /// /// The email addresses that should be CCed. /// /// The email addresses that should be CCed. [DataMember(Name = "cc_email_addresses", EmitDefaultValue = true)] public List CcEmailAddresses { get; set; } - + /// /// Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. /// /// Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "custom_fields", EmitDefaultValue = true)] public List CustomFields { get; set; } - + /// /// Gets or Sets FieldOptions /// [DataMember(Name = "field_options", EmitDefaultValue = true)] public SubFieldOptions FieldOptions { get; set; } - + /// /// 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`. /// /// 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`. [DataMember(Name = "form_field_groups", EmitDefaultValue = true)] public List FormFieldGroups { get; set; } - + /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. /// /// Conditional Logic rules for fields defined in `form_fields_per_document`. [DataMember(Name = "form_field_rules", EmitDefaultValue = true)] public List FormFieldRules { get; set; } - + /// /// 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` /// /// 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` [DataMember(Name = "form_fields_per_document", EmitDefaultValue = true)] public List FormFieldsPerDocument { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "hide_text_tags", EmitDefaultValue = true)] public bool HideTextTags { get; set; } - + /// /// The custom message in the email that will be sent to the signers. /// /// The custom message in the email that will be sent to the signers. [DataMember(Name = "message", EmitDefaultValue = true)] public string Message { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "metadata", EmitDefaultValue = true)] public Dictionary Metadata { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// Add Signers to your Unclaimed Draft Signature Request. /// /// Add Signers to your Unclaimed Draft Signature Request. [DataMember(Name = "signers", EmitDefaultValue = true)] public List Signers { get; set; } - + /// /// Gets or Sets SigningOptions /// [DataMember(Name = "signing_options", EmitDefaultValue = true)] public SubSigningOptions SigningOptions { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// The subject in the email that will be sent to the signers. /// /// The subject in the email that will be sent to the signers. [DataMember(Name = "subject", EmitDefaultValue = true)] public string Subject { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "use_preexisting_fields", EmitDefaultValue = true)] public bool UsePreexistingFields { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "use_text_tags", EmitDefaultValue = true)] public bool UseTextTags { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Returns the string presentation of the object /// @@ -577,6 +576,27 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + // Message (string) maxLength + if (this.Message != null && this.Message.Length > 5000) + { + yield return new ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); + } + + // Subject (string) maxLength + if (this.Subject != null && this.Subject.Length > 200) + { + yield return new ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); + } + + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -727,28 +747,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - // Message (string) maxLength - if (this.Message != null && this.Message.Length > 5000) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Message, length must be less than 5000.", new [] { "Message" }); - } - - // Subject (string) maxLength - if (this.Subject != null && this.Subject.Length > 200) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Subject, length must be less than 200.", new [] { "Subject" }); - } - - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/UnclaimedDraftCreateResponse.cs b/src/Dropbox.Sign/Model/UnclaimedDraftCreateResponse.cs index a42b118..e780a23 100644 --- a/src/Dropbox.Sign/Model/UnclaimedDraftCreateResponse.cs +++ b/src/Dropbox.Sign/Model/UnclaimedDraftCreateResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftCreateResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftCreateResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftCreateResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -41,11 +41,16 @@ protected UnclaimedDraftCreateResponse() { } /// /// Initializes a new instance of the class. /// - /// unclaimedDraft. + /// unclaimedDraft (required). /// A list of warnings.. public UnclaimedDraftCreateResponse(UnclaimedDraftResponse unclaimedDraft = default(UnclaimedDraftResponse), List warnings = default(List)) { + // to ensure "unclaimedDraft" is required (not null) + if (unclaimedDraft == null) + { + throw new ArgumentNullException("unclaimedDraft is a required property for UnclaimedDraftCreateResponse and cannot be null"); + } this.UnclaimedDraft = unclaimedDraft; this.Warnings = warnings; } @@ -69,16 +74,16 @@ public static UnclaimedDraftCreateResponse Init(string jsonData) /// /// Gets or Sets UnclaimedDraft /// - [DataMember(Name = "unclaimed_draft", EmitDefaultValue = true)] + [DataMember(Name = "unclaimed_draft", IsRequired = true, EmitDefaultValue = true)] public UnclaimedDraftResponse UnclaimedDraft { get; set; } - + /// /// A list of warnings. /// /// A list of warnings. [DataMember(Name = "warnings", EmitDefaultValue = true)] public List Warnings { get; set; } - + /// /// Returns the string presentation of the object /// @@ -158,6 +163,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -176,16 +190,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/UnclaimedDraftEditAndResendRequest.cs b/src/Dropbox.Sign/Model/UnclaimedDraftEditAndResendRequest.cs index 4f12d36..9639d3f 100644 --- a/src/Dropbox.Sign/Model/UnclaimedDraftEditAndResendRequest.cs +++ b/src/Dropbox.Sign/Model/UnclaimedDraftEditAndResendRequest.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftEditAndResendRequest")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftEditAndResendRequest : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftEditAndResendRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -89,55 +89,55 @@ public static UnclaimedDraftEditAndResendRequest Init(string jsonData) /// Client id of the app used to create the draft. Used to apply the branding and callback url defined for the app. [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)] public string ClientId { get; set; } - + /// /// Gets or Sets EditorOptions /// [DataMember(Name = "editor_options", EmitDefaultValue = true)] public SubEditorOptions EditorOptions { get; set; } - + /// /// The request created from this draft will also be signable in embedded mode if set to `true`. /// /// The request created from this draft will also be signable in embedded mode if set to `true`. [DataMember(Name = "is_for_embedded_signing", EmitDefaultValue = true)] public bool IsForEmbeddedSigning { get; set; } - + /// /// 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. /// /// 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. [DataMember(Name = "requester_email_address", EmitDefaultValue = true)] public string RequesterEmailAddress { get; set; } - + /// /// The URL you want signers redirected to after they successfully request a signature. /// /// The URL you want signers redirected to after they successfully request a signature. [DataMember(Name = "requesting_redirect_url", EmitDefaultValue = true)] public string RequestingRedirectUrl { get; set; } - + /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. /// /// When only one step remains in the signature request process and this parameter is set to `false` then the progress stepper will be hidden. [DataMember(Name = "show_progress_stepper", EmitDefaultValue = true)] public bool ShowProgressStepper { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. /// /// Whether this is a test, the signature request created from this draft will not be legally binding if set to `true`. Defaults to `false`. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// Returns the string presentation of the object /// @@ -264,6 +264,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -318,16 +327,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/UnclaimedDraftResponse.cs b/src/Dropbox.Sign/Model/UnclaimedDraftResponse.cs index e1ca22a..284195c 100644 --- a/src/Dropbox.Sign/Model/UnclaimedDraftResponse.cs +++ b/src/Dropbox.Sign/Model/UnclaimedDraftResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "UnclaimedDraftResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class UnclaimedDraftResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class UnclaimedDraftResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -80,42 +80,42 @@ public static UnclaimedDraftResponse Init(string jsonData) /// The ID of the signature request that is represented by this UnclaimedDraft. [DataMember(Name = "signature_request_id", EmitDefaultValue = true)] public string SignatureRequestId { get; set; } - + /// /// The URL to be used to claim this UnclaimedDraft. /// /// The URL to be used to claim this UnclaimedDraft. [DataMember(Name = "claim_url", EmitDefaultValue = true)] public string ClaimUrl { get; set; } - + /// /// The URL you want signers redirected to after they successfully sign. /// /// The URL you want signers redirected to after they successfully sign. [DataMember(Name = "signing_redirect_url", EmitDefaultValue = true)] public string SigningRedirectUrl { get; set; } - + /// /// 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.). /// /// 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.). [DataMember(Name = "requesting_redirect_url", EmitDefaultValue = true)] public string RequestingRedirectUrl { get; set; } - + /// /// When the link expires. /// /// When the link expires. [DataMember(Name = "expires_at", EmitDefaultValue = true)] public int? ExpiresAt { get; set; } - + /// /// Whether this is a test draft. Signature requests made from test drafts have no legal value. /// /// Whether this is a test draft. Signature requests made from test drafts have no legal value. [DataMember(Name = "test_mode", EmitDefaultValue = true)] public bool TestMode { get; set; } - + /// /// Returns the string presentation of the object /// @@ -230,6 +230,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -272,16 +281,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/src/Dropbox.Sign/Model/WarningResponse.cs b/src/Dropbox.Sign/Model/WarningResponse.cs index 2ab467f..7dcfa66 100644 --- a/src/Dropbox.Sign/Model/WarningResponse.cs +++ b/src/Dropbox.Sign/Model/WarningResponse.cs @@ -31,7 +31,7 @@ namespace Dropbox.Sign.Model /// [DataContract(Name = "WarningResponse")] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - public partial class WarningResponse : IOpenApiTyped, IEquatable, IValidatableObject + public partial class WarningResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -82,14 +82,14 @@ public static WarningResponse Init(string jsonData) /// Warning message [DataMember(Name = "warning_msg", IsRequired = true, EmitDefaultValue = true)] public string WarningMsg { get; set; } - + /// /// Warning name /// /// Warning name [DataMember(Name = "warning_name", IsRequired = true, EmitDefaultValue = true)] public string WarningName { get; set; } - + /// /// Returns the string presentation of the object /// @@ -168,6 +168,15 @@ public override int GetHashCode() } } + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } public List GetOpenApiTypes() { var types = new List(); @@ -186,16 +195,6 @@ public List GetOpenApiTypes() return types; } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } } } diff --git a/templates/AbstractOpenAPISchema.mustache b/templates/AbstractOpenAPISchema.mustache index 6b40f25..269e4ee 100644 --- a/templates/AbstractOpenAPISchema.mustache +++ b/templates/AbstractOpenAPISchema.mustache @@ -1,12 +1,15 @@ {{>partial_header}} using System; -using System.Collections.Generic; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +{{#useCustomTemplateCode}} +using System.Collections.Generic; +{{/useCustomTemplateCode}} namespace {{packageName}}.{{modelPackage}} { +{{#useCustomTemplateCode}} public struct OpenApiType { public string Name { set; get; } @@ -20,6 +23,7 @@ namespace {{packageName}}.{{modelPackage}} List GetOpenApiTypes(); } +{{/useCustomTemplateCode}} /// /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification /// diff --git a/templates/ApiClient.mustache b/templates/ApiClient.mustache index 54f7dea..f8798bd 100644 --- a/templates/ApiClient.mustache +++ b/templates/ApiClient.mustache @@ -14,20 +14,22 @@ using System.Text; using System.Threading; using System.Text.RegularExpressions; using System.Threading.Tasks; -{{^netStandard}} +{{^net60OrLater}} using System.Web; -{{/netStandard}} +{{/net60OrLater}} using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; +using FileIO = System.IO.File; {{#supportsRetry}} using Polly; {{/supportsRetry}} {{#hasOAuthMethods}} using {{packageName}}.Client.Auth; {{/hasOAuthMethods}} +using {{packageName}}.{{modelPackage}}; namespace {{packageName}}.Client { @@ -37,7 +39,6 @@ namespace {{packageName}}.Client internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer { private readonly IReadableConfiguration _configuration; - private static readonly string _contentType = "application/json"; private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. @@ -69,10 +70,10 @@ namespace {{packageName}}.Client /// A JSON string. public string Serialize(object obj) { - if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + if (obj != null && obj is AbstractOpenAPISchema) { // the object to be serialized is an oneOf/anyOf schema - return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + return ((AbstractOpenAPISchema)obj).ToJson(); } else { @@ -117,7 +118,7 @@ namespace {{packageName}}.Client if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, bytes); + FileIO.WriteAllBytes(fileName, bytes); return new FileStream(fileName, FileMode.Open); } } @@ -128,7 +129,7 @@ namespace {{packageName}}.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type @@ -150,17 +151,13 @@ namespace {{packageName}}.Client public ISerializer Serializer => this; public IDeserializer Deserializer => this; - public string[] AcceptedContentTypes => RestSharp.Serializers.ContentType.JsonAccept; + public string[] AcceptedContentTypes => ContentType.JsonAccept; public SupportsContentType SupportsContentType => contentType => - contentType.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || - contentType.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); + contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) || + contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase); - public string ContentType - { - get { return _contentType; } - set { throw new InvalidOperationException("Not allowed to set content type."); } - } + public ContentType ContentType { get; set; } = ContentType.Json; public DataFormat DataFormat => DataFormat.Json; } @@ -173,10 +170,11 @@ namespace {{packageName}}.Client { private readonly string _baseUrl; +{{#useCustomTemplateCode}} private readonly RestClient _restClient; - - /// +{{/useCustomTemplateCode}} + /// /// Specifies the settings on a object. /// These settings can be adjusted to accommodate custom serialization rules. /// @@ -211,7 +209,7 @@ namespace {{packageName}}.Client /// public ApiClient() { - _baseUrl = {{packageName}}.Client.GlobalConfiguration.Instance.BasePath; + _baseUrl = GlobalConfiguration.Instance.BasePath; } /// @@ -227,6 +225,7 @@ namespace {{packageName}}.Client _baseUrl = basePath; } +{{#useCustomTemplateCode}} /// /// Initializes a new instance of the . This should be used in unit tests only /// @@ -242,6 +241,7 @@ namespace {{packageName}}.Client _restClient = mockClient; } +{{/useCustomTemplateCode}} /// /// Constructs the RestSharp version of an http method /// @@ -283,14 +283,14 @@ namespace {{packageName}}.Client /// /// Provides all logic for constructing a new RestSharp . - /// At this point, all information for querying the service is known. Here, it is simply - /// mapped into the RestSharp request. + /// At this point, all information for querying the service is known. + /// Here, it is simply mapped into the RestSharp request. /// /// The http verb. /// The target path (or resource). /// The additional request options. - /// A per-request configuration object. It is assumed that any merge with - /// GlobalConfiguration has been done before calling this method. + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// private RestRequest NewRequest( @@ -398,7 +398,7 @@ namespace {{packageName}}.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } @@ -408,6 +408,13 @@ namespace {{packageName}}.Client return request; } + /// + /// Transforms a RestResponse instance into a new ApiResponse instance. + /// At this point, we have a concrete http response from the service. + /// Here, it is simply mapped into the [public] ApiResponse object. + /// + /// The RestSharp response object + /// A new ApiResponse instance. private ApiResponse ToApiResponse(RestResponse response) { T result = response.Data; @@ -452,236 +459,207 @@ namespace {{packageName}}.Client return transformed; } - private ApiResponse Exec(RestRequest req, RequestOptions options, IReadableConfiguration configuration) + /// + /// Executes the HTTP request for the current service. + /// Based on functions received it can be async or sync. + /// + /// Local function that executes http request and returns http response. + /// Local function to specify options for the service. + /// The RestSharp request object + /// The RestSharp options object + /// A per-request configuration object. + /// It is assumed that any merge with GlobalConfiguration has been done before calling this method. + /// A new ApiResponse instance. + private async Task> ExecClientAsync(Func>> getResponse, Action setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration) { var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var cookies = new CookieContainer(); - - if (options.Cookies != null && options.Cookies.Count > 0) - { - foreach (var cookie in options.Cookies) - { - cookies.Add(new Cookie(cookie.Name, cookie.Value)); - } - } - var clientOptions = new RestClientOptions(baseUrl) { ClientCertificates = configuration.ClientCertificates, - CookieContainer = cookies, MaxTimeout = configuration.Timeout, Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent + UserAgent = configuration.UserAgent, + UseDefaultCredentials = configuration.UseDefaultCredentials, + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback }; - - RestClient client = _restClient; - if (client == null) - { - client = new RestClient(clientOptions); - } - - client.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)); - + setOptions(clientOptions); + {{#hasOAuthMethods}} if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && !string.IsNullOrEmpty(configuration.OAuthClientId) && !string.IsNullOrEmpty(configuration.OAuthClientSecret) && configuration.OAuthFlow != null) { - client = client.UseAuthenticator(new OAuthAuthenticator( + clientOptions.Authenticator = new OAuthAuthenticator( configuration.OAuthTokenUrl, configuration.OAuthClientId, configuration.OAuthClientSecret, + configuration.OAuthScope, configuration.OAuthFlow, SerializerSettings, - configuration)); + configuration); } {{/hasOAuthMethods}} - InterceptRequest(req); - - RestResponse response; - if (RetryConfiguration.RetryPolicy != null) +{{^useCustomTemplateCode}} + using (RestClient client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)))) { - var policy = RetryConfiguration.RetryPolicy; - var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse - { - Request = req, - ErrorException = policyResult.FinalException - }; - } - else +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + RestClient client = _restClient; + if (client == null) { - response = client.Execute(req); + client = new RestClient(clientOptions, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)) + ); } - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + using (client) +{{/useCustomTemplateCode}} { - try + InterceptRequest(request); + + RestResponse response = await getResponse(client); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + try + { + response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + } + catch (Exception ex) + { + throw ex.InnerException != null ? ex.InnerException : ex; + } } - catch (Exception ex) + else if (typeof(T).Name == "Stream") // for binary response { - throw ex.InnerException != null ? ex.InnerException : ex; + response.Data = (T)(object)new MemoryStream(response.RawBytes); + } + else if (typeof(T).Name == "Byte[]") // for byte response + { + response.Data = (T)(object)response.RawBytes; + } + else if (typeof(T).Name == "String") // for string response + { + response.Data = (T)(object)response.Content; } - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response - { - response.Data = (T)(object)response.RawBytes; - } - else if (typeof(T).Name == "String") // for string response - { - response.Data = (T)(object)response.Content; - } - InterceptResponse(req, response); + InterceptResponse(request, response); - var result = ToApiResponse(response); - if (response.ErrorMessage != null) - { - result.ErrorText = response.ErrorMessage; - } + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } - if (response.Cookies != null && response.Cookies.Count > 0) - { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + if (response.Cookies != null && response.Cookies.Count > 0) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) + if (result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies.Cast()) { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } } + return result; } - return result; } - {{#supportsAsync}} - private async Task> ExecAsync(RestRequest req, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + private RestResponse DeserializeRestResponseFromPolicy(RestClient client, RestRequest request, PolicyResult policyResult) { - var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl; - - var clientOptions = new RestClientOptions(baseUrl) - { - ClientCertificates = configuration.ClientCertificates, - MaxTimeout = configuration.Timeout, - Proxy = configuration.Proxy, - UserAgent = configuration.UserAgent - }; - - RestClient client = new RestClient(clientOptions) - .UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration)); - - {{#hasOAuthMethods}} - if (!string.IsNullOrEmpty(configuration.OAuthTokenUrl) && - !string.IsNullOrEmpty(configuration.OAuthClientId) && - !string.IsNullOrEmpty(configuration.OAuthClientSecret) && - configuration.OAuthFlow != null) + if (policyResult.Outcome == OutcomeType.Successful) { - client = client.UseAuthenticator(new OAuthAuthenticator( - configuration.OAuthTokenUrl, - configuration.OAuthClientId, - configuration.OAuthClientSecret, - configuration.OAuthFlow, - SerializerSettings, - configuration)); + return client.Deserialize(policyResult.Result); } - - {{/hasOAuthMethods}} - InterceptRequest(req); - - RestResponse response; - {{#supportsRetry}} - if (RetryConfiguration.AsyncRetryPolicy != null) + else { - var policy = RetryConfiguration.AsyncRetryPolicy; - var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(req, ct), cancellationToken).ConfigureAwait(false); - response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize(policyResult.Result) : new RestResponse + return new RestResponse(request) { - Request = req, ErrorException = policyResult.FinalException }; } - else + } + + private ApiResponse Exec(RestRequest request, RequestOptions options, IReadableConfiguration configuration) + { + Action setOptions = (clientOptions) => { - {{/supportsRetry}} - response = await client.ExecuteAsync(req, cancellationToken).ConfigureAwait(false); - {{#supportsRetry}} - } - {{/supportsRetry}} + var cookies = new CookieContainer(); - // if the response type is oneOf/anyOf, call FromJSON to deserialize the data - if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) - { - response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); - } - else if (typeof(T).Name == "Stream") // for binary response - { - response.Data = (T)(object)new MemoryStream(response.RawBytes); - } - else if (typeof(T).Name == "Byte[]") // for byte response + if (options.Cookies != null && options.Cookies.Count > 0) + { + foreach (var cookie in options.Cookies) + { + cookies.Add(new Cookie(cookie.Name, cookie.Value)); + } + } + clientOptions.CookieContainer = cookies; + }; + + Func>> getResponse = (client) => { - response.Data = (T)(object)response.RawBytes; - } + if (RetryConfiguration.RetryPolicy != null) + { + var policy = RetryConfiguration.RetryPolicy; + var policyResult = policy.ExecuteAndCapture(() => client.Execute(request)); + return Task.FromResult(DeserializeRestResponseFromPolicy(client, request, policyResult)); + } + else + { + return Task.FromResult(client.Execute(request)); + } + }; - InterceptResponse(req, response); + return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); + } - var result = ToApiResponse(response); - if (response.ErrorMessage != null) + {{#supportsAsync}} + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + { + Action setOptions = (clientOptions) => { - result.ErrorText = response.ErrorMessage; - } + //no extra options + }; - if (response.Cookies != null && response.Cookies.Count > 0) + Func>> getResponse = async (client) => { - if (result.Cookies == null) result.Cookies = new List(); - foreach (var restResponseCookie in response.Cookies.Cast()) + {{#supportsRetry}} + if (RetryConfiguration.AsyncRetryPolicy != null) { - var cookie = new Cookie( - restResponseCookie.Name, - restResponseCookie.Value, - restResponseCookie.Path, - restResponseCookie.Domain - ) - { - Comment = restResponseCookie.Comment, - CommentUri = restResponseCookie.CommentUri, - Discard = restResponseCookie.Discard, - Expired = restResponseCookie.Expired, - Expires = restResponseCookie.Expires, - HttpOnly = restResponseCookie.HttpOnly, - Port = restResponseCookie.Port, - Secure = restResponseCookie.Secure, - Version = restResponseCookie.Version - }; - - result.Cookies.Add(cookie); + var policy = RetryConfiguration.AsyncRetryPolicy; + var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); + return DeserializeRestResponseFromPolicy(client, request, policyResult); } - } - return result; + else + { + {{/supportsRetry}} + return await client.ExecuteAsync(request, cancellationToken).ConfigureAwait(false); + {{#supportsRetry}} + } + {{/supportsRetry}} + }; + + return ExecClientAsync(getResponse, setOptions, request, options, configuration); } #region IAsynchronousClient @@ -694,7 +672,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken); @@ -709,7 +687,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken); @@ -724,7 +702,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken); @@ -739,7 +717,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken); @@ -754,7 +732,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken); @@ -769,7 +747,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken); @@ -784,7 +762,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken); diff --git a/templates/ApiException.mustache b/templates/ApiException.mustache index e5a99a5..622d10c 100644 --- a/templates/ApiException.mustache +++ b/templates/ApiException.mustache @@ -1,7 +1,9 @@ {{>partial_header}} using System; +{{#useCustomTemplateCode}} using Dropbox.Sign.Model; +{{/useCustomTemplateCode}} namespace {{packageName}}.Client { @@ -20,7 +22,12 @@ namespace {{packageName}}.Client /// Gets or sets the error content (body json object) /// /// The error content (Http response body). +{{^useCustomTemplateCode}} + public object ErrorContent { get; private set; } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} public ErrorResponse ErrorContent { get; private set; } +{{/useCustomTemplateCode}} /// /// Gets or sets the HTTP headers @@ -50,7 +57,12 @@ namespace {{packageName}}.Client /// Error message. /// Error content. /// HTTP Headers. +{{^useCustomTemplateCode}} + public ApiException(int errorCode, string message, object errorContent = null, Multimap headers = null) : base(message) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} public ApiException(int errorCode, string message, ErrorResponse errorContent = null, Multimap headers = null) : base(message) +{{/useCustomTemplateCode}} { this.ErrorCode = errorCode; this.ErrorContent = errorContent; diff --git a/templates/ClientUtils.mustache b/templates/ClientUtils.mustache index 08a4362..cacf67e 100644 --- a/templates/ClientUtils.mustache +++ b/templates/ClientUtils.mustache @@ -6,14 +6,16 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using {{packageName}}.Model; {{#useCompareNetObjects}} using KellermanSoftware.CompareNetObjects; {{/useCompareNetObjects}} +{{#useCustomTemplateCode}} +using Newtonsoft.Json; +using {{packageName}}.Model; +{{/useCustomTemplateCode}} namespace {{packageName}}.Client { @@ -33,7 +35,11 @@ namespace {{packageName}}.Client /// static ClientUtils() { - compareLogic = new CompareLogic(); + {{#equatable}} + ComparisonConfig comparisonConfig = new{{^net70OrLater}} ComparisonConfig{{/net70OrLater}}(); + comparisonConfig.UseHashCodeIdentifier = true; + {{/equatable}} + compareLogic = new{{^net70OrLater}} CompareLogic{{/net70OrLater}}({{#equatable}}comparisonConfig{{/equatable}}); } {{/useCompareNetObjects}} @@ -114,8 +120,12 @@ namespace {{packageName}}.Client return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); if (obj is bool boolean) return boolean ? "true" : "false"; - if (obj is ICollection collection) - return string.Join(",", collection.Cast()); + if (obj is ICollection collection) { + List entries = new List(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry, configuration)); + return string.Join(",", entries); + } if (obj is Enum && HasEnumMemberAttrValue(obj)) return GetEnumMemberAttrValue(obj); @@ -139,7 +149,7 @@ namespace {{packageName}}.Client /// Encoded string. public static string Base64Encode(string text) { - return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); } /// @@ -238,7 +248,12 @@ namespace {{packageName}}.Client /// /// /// EnumMember value as string otherwise null +{{^useCustomTemplateCode}} + private static string GetEnumMemberAttrValue(object enumVal) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} public static string GetEnumMemberAttrValue(object enumVal) +{{/useCustomTemplateCode}} { if (enumVal == null) throw new ArgumentNullException(nameof(enumVal)); @@ -251,6 +266,7 @@ namespace {{packageName}}.Client } return null; } +{{#useCustomTemplateCode}} /// /// Tests if value is a System.IO.Stream or list of System.IO.Stream @@ -302,7 +318,7 @@ namespace {{packageName}}.Client item.Value.ToString() ); - continue; + continue; } if (item.Value is Enum) @@ -333,5 +349,6 @@ namespace {{packageName}}.Client ); } } +{{/useCustomTemplateCode}} } } diff --git a/templates/Configuration.mustache b/templates/Configuration.mustache index 54f87f8..64441d8 100644 --- a/templates/Configuration.mustache +++ b/templates/Configuration.mustache @@ -11,14 +11,16 @@ using System.Net; using System.Reflection; using System.Security.Cryptography.X509Certificates; using System.Text; -using Newtonsoft.Json; using System.Net.Http; +using System.Net.Security; {{#useRestSharp}} {{#hasOAuthMethods}}using {{packageName}}.Client.Auth; {{/hasOAuthMethods}} {{/useRestSharp}} +{{#useCustomTemplateCode}} +using Newtonsoft.Json; using Dropbox.Sign.Model; - +{{/useCustomTemplateCode}} namespace {{packageName}}.Client { @@ -56,13 +58,23 @@ namespace {{packageName}}.Client { return new ApiException(status, string.Format("Error calling {0}: {1}", methodName, response.RawContent), +{{^useCustomTemplateCode}} + response.RawContent, response.Headers); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} JsonConvert.DeserializeObject(response.RawContent), response.Headers); +{{/useCustomTemplateCode}} } {{^netStandard}} if (status == 0) { return new ApiException(status, +{{^useCustomTemplateCode}} + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} string.Format("Error calling {0}: {1}", methodName, response.ErrorText), JsonConvert.DeserializeObject(response.ErrorText)); +{{/useCustomTemplateCode}} } {{/netStandard}} return null; @@ -78,6 +90,8 @@ namespace {{packageName}}.Client /// private string _basePath; + private bool _useDefaultCredentials = false; + /// /// Gets or sets the API key based on the authentication name. /// This is the key and value comprising the "secret" for accessing an API. @@ -122,7 +136,7 @@ namespace {{packageName}}.Client /// /// Initializes a new instance of the class /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration() { Proxy = null; @@ -148,7 +162,7 @@ namespace {{packageName}}.Client { "{{{name}}}", new Dictionary { {"description", "{{{description}}}{{^description}}No description provided{{/description}}"}, - {"default_value", "{{{defaultValue}}}"}, + {"default_value", {{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}"{{{defaultValue}}}"}, {{#enumValues}} {{#-first}} { @@ -208,7 +222,7 @@ namespace {{packageName}}.Client /// /// Initializes a new instance of the class /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] + [global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration( IDictionary defaultHeaders, IDictionary apiKey, @@ -249,11 +263,21 @@ namespace {{packageName}}.Client /// /// Gets or sets the base path for API access. /// - public virtual string BasePath { + public virtual string BasePath + { get { return _basePath; } set { _basePath = value; } } + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + public virtual bool UseDefaultCredentials + { + get { return _useDefaultCredentials; } + set { _useDefaultCredentials = value; } + } + /// /// Gets or sets the default header. /// @@ -356,6 +380,12 @@ namespace {{packageName}}.Client /// The OAuth Client Secret. public virtual string OAuthClientSecret { get; set; } + /// + /// Gets or sets the client scope for OAuth2 authentication. + /// + /// The OAuth Client Scope. + public virtual string{{nrt?}} OAuthScope { get; set; } + /// /// Gets or sets the flow for OAuth2 authentication. /// @@ -547,7 +577,7 @@ namespace {{packageName}}.Client /// The operation server URL. public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables) { - if (OperationServers.TryGetValue(operation, out var operationServer)) + if (operation != null && OperationServers.TryGetValue(operation, out var operationServer)) { return GetServerUrl(operationServer, index, inputVariables); } @@ -618,6 +648,11 @@ namespace {{packageName}}.Client set { _HttpSigningConfiguration = value; } } {{/hasHttpSignatureMethods}} + + /// + /// Gets and Sets the RemoteCertificateValidationCallback + /// + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } #endregion Properties @@ -696,6 +731,7 @@ namespace {{packageName}}.Client OAuthTokenUrl = second.OAuthTokenUrl ?? first.OAuthTokenUrl, OAuthClientId = second.OAuthClientId ?? first.OAuthClientId, OAuthClientSecret = second.OAuthClientSecret ?? first.OAuthClientSecret, + OAuthScope = second.OAuthScope ?? first.OAuthScope, OAuthFlow = second.OAuthFlow ?? first.OAuthFlow, {{/hasOAuthMethods}} {{/useRestSharp}} @@ -705,6 +741,8 @@ namespace {{packageName}}.Client TempFolderPath = second.TempFolderPath ?? first.TempFolderPath, DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat, ClientCertificates = second.ClientCertificates ?? first.ClientCertificates, + UseDefaultCredentials = second.UseDefaultCredentials, + RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback, }; return config; } diff --git a/templates/HttpSigningConfiguration.mustache b/templates/HttpSigningConfiguration.mustache index 6b773b8..faca675 100644 --- a/templates/HttpSigningConfiguration.mustache +++ b/templates/HttpSigningConfiguration.mustache @@ -18,7 +18,6 @@ namespace {{packageName}}.Client /// public class HttpSigningConfiguration { - #region /// /// Initialize the HashAlgorithm and SigningAlgorithm to default value /// @@ -27,9 +26,7 @@ namespace {{packageName}}.Client HashAlgorithm = HashAlgorithmName.SHA256; SigningAlgorithm = "PKCS1-v15"; } - #endregion - #region Properties /// ///Gets the Api keyId /// @@ -40,6 +37,11 @@ namespace {{packageName}}.Client /// public string KeyFilePath { get; set; } + /// + /// Specify the API key in the form of a string, either configure the KeyString property or configure the KeyFilePath property. + /// + public string KeyString { get; set; } + /// /// Gets the key pass phrase for password protected key /// @@ -65,18 +67,13 @@ namespace {{packageName}}.Client /// public int SignatureValidityPeriod { get; set; } - #endregion - - #region enum private enum PrivateKeyType { None = 0, RSA = 1, ECDSA = 2, } - #endregion - #region Methods /// /// Gets the Headers for HttpSigning /// @@ -85,7 +82,7 @@ namespace {{packageName}}.Client /// Path /// Request options /// Http signed headers - internal Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) + public Dictionary GetHttpSignedHeader(string basePath,string method, string path, RequestOptions requestOptions) { const string HEADER_REQUEST_TARGET = "(request-target)"; //The time when the HTTP signature expires. The API server should reject HTTP requests @@ -104,6 +101,16 @@ namespace {{packageName}}.Client //the list of signed headers and a base64-encoded signature. const string HEADER_AUTHORIZATION = "Authorization"; + //Read the api key from the file + if(File.Exists(KeyFilePath)) + { + this.KeyString = ReadApiKeyFromFile(KeyFilePath); + } + else if(string.IsNullOrEmpty(KeyString)) + { + throw new Exception("No API key has been provided. Supply it using either KeyFilePath or KeyString"); + } + //Hash table to store singed headers var HttpSignedRequestHeader = new Dictionary(); var HttpSignatureHeader = new Dictionary(); @@ -167,12 +174,12 @@ namespace {{packageName}}.Client if (HashAlgorithm == HashAlgorithmName.SHA256) { - var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); Digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); } else if (HashAlgorithm == HashAlgorithmName.SHA512) { - var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); Digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); } else @@ -240,9 +247,9 @@ namespace {{packageName}}.Client } //Concatenate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); - var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString); + var signatureStringHash = GetStringHash(HashAlgorithm, headerValuesString); string headerSignatureStr = null; - var keyType = GetKeyType(KeyFilePath); + var keyType = GetKeyType(KeyString); if (keyType == PrivateKeyType.RSA) { @@ -276,11 +283,27 @@ namespace {{packageName}}.Client return HttpSignedRequestHeader; } - private byte[] GetStringHash(string hashName, string stringToBeHashed) + private byte[] GetStringHash(HashAlgorithmName hashAlgorithmName, string stringToBeHashed) { - var hashAlgorithm = System.Security.Cryptography.HashAlgorithm.Create(hashName); - var bytes = Encoding.UTF8.GetBytes(stringToBeHashed); - var stringHash = hashAlgorithm.ComputeHash(bytes); + HashAlgorithm{{nrt?}} hashAlgorithm = null; + + if (hashAlgorithmName == HashAlgorithmName.SHA1) + hashAlgorithm = SHA1.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA256) + hashAlgorithm = SHA256.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA512) + hashAlgorithm = SHA512.Create(); + + if (hashAlgorithmName == HashAlgorithmName.MD5) + hashAlgorithm = MD5.Create(); + + if (hashAlgorithm == null) + throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); + + byte[] bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + byte[] stringHash = hashAlgorithm.ComputeHash(bytes); return stringHash; } @@ -293,7 +316,11 @@ namespace {{packageName}}.Client private string GetRSASignature(byte[] stringToSign) { - RSA rsa = GetRSAProviderFromPemFile(KeyFilePath, KeyPassPhrase); + if (string.IsNullOrEmpty(KeyString)) + { + throw new Exception("No API key has been provided."); + } + RSA rsa = GetRSAProviderFromPemFile(KeyString, KeyPassPhrase); if (SigningAlgorithm == "RSASSA-PSS") { var signedbytes = rsa.SignHash(stringToSign, HashAlgorithm, RSASignaturePadding.Pss); @@ -317,23 +344,19 @@ namespace {{packageName}}.Client /// ECDSA signature private string GetECDSASignature(byte[] dataToSign) { - string keyStr = string.Empty; - if (File.Exists(KeyFilePath)) - { - keyStr = File.ReadAllText(KeyFilePath); - } - else + {{#net60OrLater}} + if (!File.Exists(KeyFilePath) && string.IsNullOrEmpty(KeyString)) { - keyStr = KeyFilePath; + throw new Exception("No API key has been provided."); } + var keyStr = KeyString; const string ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; const string ecKeyFooter = "-----END EC PRIVATE KEY-----"; var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); var ecdsa = ECDsa.Create(); -#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) var byteCount = 0; if (KeyPassPhrase != null) { @@ -353,19 +376,23 @@ namespace {{packageName}}.Client } } else - { ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); - } - var signedBytes = ecdsa.SignHash(dataToSign); - var derBytes = ConvertToECDSAANS1Format(signedBytes); + + var derBytes = ecdsa.SignHash(dataToSign, DSASignatureFormat.Rfc3279DerSequence); var signedString = System.Convert.ToBase64String(derBytes); return signedString; -#else + {{/net60OrLater}} + {{^net60OrLater}} throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); -#endif + {{/net60OrLater}} } + /// + /// Convert ANS1 format to DER format. Not recommended to use because it generate inavlid signature occationally. + /// + /// + /// private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); @@ -419,22 +446,18 @@ namespace {{packageName}}.Client return derBytes.ToArray(); } - private RSACryptoServiceProvider GetRSAProviderFromPemFile(string pemfile, SecureString keyPassPhrase = null) + private RSACryptoServiceProvider GetRSAProviderFromPemFile(string keyString, SecureString keyPassPhrase = null) { + if (string.IsNullOrEmpty(KeyString)) + { + throw new Exception("No API key has been provided."); + } + const string pempubheader = "-----BEGIN PUBLIC KEY-----"; const string pempubfooter = "-----END PUBLIC KEY-----"; bool isPrivateKeyFile = true; byte[] pemkey = null; - - string pemstr = string.Empty; - if (File.Exists(pemfile)) - { - pemstr = File.ReadAllText(pemfile).Trim(); - } - else - { - pemstr = pemfile; - } + string pemstr = keyString; if (pemstr.StartsWith(pempubheader) && pemstr.EndsWith(pempubfooter)) { @@ -475,7 +498,7 @@ namespace {{packageName}}.Client binkey = Convert.FromBase64String(pvkstr); return binkey; } - catch (System.FormatException) + catch (global::System.FormatException) { StringReader str = new StringReader(pvkstr); @@ -505,7 +528,7 @@ namespace {{packageName}}.Client { //should have b64 encrypted RSA key now binkey = Convert.FromBase64String(encryptedstr); } - catch (System.FormatException) + catch (global::System.FormatException) { //data is not in base64 format return null; } @@ -663,7 +686,7 @@ namespace {{packageName}}.Client Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- - MD5 md5 = new MD5CryptoServiceProvider(); + MD5 md5 = MD5.Create(); byte[] result = null; byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget @@ -721,20 +744,15 @@ namespace {{packageName}}.Client /// /// Detect the key type from the pem file. /// - /// key file path in pem format + /// api key in string format /// Private Key Type - private PrivateKeyType GetKeyType(string keyFilePath) + private PrivateKeyType GetKeyType(string keyString) { string[] key = null; - if (File.Exists(keyFilePath)) - { - key = File.ReadAllLines(keyFilePath); - } - else + if (string.IsNullOrEmpty(keyString)) { - // The ApiKeyFilePath is passed as string - key = new string[] { keyFilePath }; + throw new Exception("No API key has been provided."); } const string ecPrivateKeyHeader = "BEGIN EC PRIVATE KEY"; @@ -744,6 +762,7 @@ namespace {{packageName}}.Client //var pkcs8Header = "BEGIN PRIVATE KEY"; //var pkcs8Footer = "END PRIVATE KEY"; PrivateKeyType keyType; + key = KeyString.TrimEnd().Split('\n'); if (key[0].Contains(rsaPrivateKeyHeader) && key[key.Length - 1].ToString().Contains(rsaPrivateFooter)) @@ -761,6 +780,24 @@ namespace {{packageName}}.Client } return keyType; } - #endregion + + /// + /// Read the api key form the api key file path and stored it in KeyString property. + /// + /// api key file path + private string ReadApiKeyFromFile(string apiKeyFilePath) + { + string apiKeyString = null; + + if(File.Exists(apiKeyFilePath)) + { + apiKeyString = File.ReadAllText(apiKeyFilePath); + } + else + { + throw new Exception("Provided API key file path does not exists."); + } + return apiKeyString; + } } } diff --git a/templates/IAsynchronousClient.mustache b/templates/IAsynchronousClient.mustache index f0c88fa..76ddd4a 100644 --- a/templates/IAsynchronousClient.mustache +++ b/templates/IAsynchronousClient.mustache @@ -21,7 +21,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the POST http verb. @@ -32,7 +32,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -43,7 +43,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -54,7 +54,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -65,7 +65,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -76,7 +76,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -87,6 +87,6 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); } } diff --git a/templates/IReadableConfiguration.mustache b/templates/IReadableConfiguration.mustache index 3d36483..5981728 100644 --- a/templates/IReadableConfiguration.mustache +++ b/templates/IReadableConfiguration.mustache @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Net; +using System.Net.Security; using System.Security.Cryptography.X509Certificates; {{#useRestSharp}} {{#hasOAuthMethods}}using {{packageName}}.Client.Auth; @@ -42,6 +43,12 @@ namespace {{packageName}}.Client /// OAuth Client Secret. string OAuthClientSecret { get; } + /// + /// Gets the OAuth token scope. + /// + /// OAuth Token scope. + string{{nrt?}} OAuthScope { get; } + /// /// Gets the OAuth flow. /// @@ -123,6 +130,11 @@ namespace {{packageName}}.Client /// Password. string Password { get; } + /// + /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false. + /// + bool UseDefaultCredentials { get; } + /// /// Get the servers associated with the operation. /// @@ -156,5 +168,11 @@ namespace {{packageName}}.Client /// HttpSigningConfiguration HttpSigningConfiguration { get; } {{/hasHttpSignatureMethods}} + + /// + /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and + /// overriding certificate errors in the scope of a request. + /// + RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; } } } diff --git a/templates/NullConditionalParameter.mustache b/templates/NullConditionalParameter.mustache new file mode 100644 index 0000000..d8ad926 --- /dev/null +++ b/templates/NullConditionalParameter.mustache @@ -0,0 +1 @@ +{{#isNullable}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}} \ No newline at end of file diff --git a/templates/NullConditionalProperty.mustache b/templates/NullConditionalProperty.mustache new file mode 100644 index 0000000..7dcafa8 --- /dev/null +++ b/templates/NullConditionalProperty.mustache @@ -0,0 +1 @@ +{{#lambda.first}}{{#isNullable}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} \ No newline at end of file diff --git a/templates/README.mustache b/templates/README.mustache index 78e6859..f70a5da 100644 --- a/templates/README.mustache +++ b/templates/README.mustache @@ -4,6 +4,7 @@ {{{.}}} {{/appDescriptionWithNewLines}} +{{#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). @@ -22,6 +23,7 @@ Pull Requests *must* be opened against the You must make SDK code changes in the mustache file within the `templates` directory that corresponds to the file you want updated. +{{/useCustomTemplateCode}} This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} @@ -29,11 +31,13 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} - Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) {{/infoUrl}} +{{#useCustomTemplateCode}} ### Building You must have `docker` (or `podman` linked to `docker`) installed. Highly @@ -50,7 +54,8 @@ Run the following and everything is done for you: to the OAS file and/or the mustache template files _will be lost_ when you run this command. - +{{/useCustomTemplateCode}} + ## Frameworks supported {{#netStandard}} - .NET Core >=1.0 @@ -58,14 +63,14 @@ this command. - Mono/Xamarin >=vNext {{/netStandard}} - + ## Dependencies {{#useRestSharp}} -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 108.0.1 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later {{/useRestSharp}} -- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.1 or later -- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.9.0 or later +- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 13.0.2 or later +- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.8.0 or later {{#useCompareNetObjects}} - [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later {{/useCompareNetObjects}} @@ -73,7 +78,65 @@ this command. - [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 5.0.0 or later {{/validatable}} - +{{^useCustomTemplateCode}} +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +``` +{{#useRestSharp}} +Install-Package RestSharp +{{/useRestSharp}} +Install-Package Newtonsoft.Json +Install-Package JsonSubTypes +{{#validatable}} +Install-Package System.ComponentModel.Annotations +{{/validatable}} +{{#useCompareNetObjects}} +Install-Package CompareNETObjects +{{/useCompareNetObjects}} +``` +{{#useRestSharp}} + +NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742). +NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406). + +{{/useRestSharp}} + +## Installation +{{#netStandard}} +Generate the DLL using your preferred tool (e.g. `dotnet build`) +{{/netStandard}} +{{^netStandard}} +Run the following command to generate the DLL +- [Mac/Linux] `/bin/sh build.sh` +- [Windows] `build.bat` +{{/netStandard}} + +Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: +```csharp +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; +``` +{{^netStandard}} + +## Packaging + +A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages. + +This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly: + +``` +nuget pack -Build -OutputDirectory out {{packageName}}.csproj +``` + +Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual. + +{{/netStandard}} +{{/useCustomTemplateCode}} + +{{^useCustomTemplateCode}} +## Usage +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ## Installation & Usage ### NuGet Package Manager @@ -85,6 +148,7 @@ The Dropbox Sign .NET SDK can be installed using the NuGet package manager, unde You can follow the NuGet quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli#publish-the-package) the package via the dotnet CLI. Or, you can [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-visual-studio?tabs=netcore-cli) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-visual-studio?tabs=netcore-cli#publish-the-package) using Visual Studio. Alternatively, the .nupkg can be published to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consumed via NuGet as usual. +{{/useCustomTemplateCode}} To use the API client with a HTTP proxy, setup a `System.Net.WebProxy` ```csharp @@ -123,14 +187,103 @@ services.AddHttpClient(httpClient => {{/useHttpClient}} - + +{{^useCustomTemplateCode}} +## Getting Started + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +{{#useHttpClient}} +using System.Net.Http; +{{/useHttpClient}} +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace Example +{ + public class {{operationId}}Example + { + public static void Main() + { +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + {{#useHttpClient}} + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new {{classname}}(httpClient, config, httpClientHandler); + {{/useHttpClient}} + {{^useHttpClient}} + var apiInstance = new {{classname}}(config); + {{/useHttpClient}} + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.WriteLine(result);{{/returnType}} + } + catch (ApiException e) + { + Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + } + } +} +``` +{{/useCustomTemplateCode}} + +{{#useCustomTemplateCode}} ## Getting Started + {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} ```csharp REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_C#_CODE ``` {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} - +{{/useCustomTemplateCode}} + + ## Documentation for API Endpoints All URIs are relative to *{{{basePath}}}* @@ -140,7 +293,7 @@ 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 {{#modelPackage}} @@ -151,19 +304,13 @@ Class | Method | HTTP request | Description No model defined in this package {{/modelPackage}} - + ## Documentation for Authorization -{{^authMethods}} -All endpoints do not require authorization. -{{/authMethods}} -{{#authMethods}} -{{#last}} -Authentication schemes defined for the API: -{{/last}} -{{/authMethods}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} {{#authMethods}} - + ### {{name}} {{#isApiKey}}- **Type**: API key @@ -174,6 +321,8 @@ Authentication schemes defined for the API: {{/isBasicBasic}} {{#isBasicBearer}}- **Type**: Bearer Authentication {{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{#isOAuth}}- **Type**: OAuth - **Flow**: {{flow}} - **Authorization URL**: {{authorizationUrl}} diff --git a/templates/RequestOptions.mustache b/templates/RequestOptions.mustache index 40436b9..cfc1469 100644 --- a/templates/RequestOptions.mustache +++ b/templates/RequestOptions.mustache @@ -25,7 +25,7 @@ namespace {{packageName}}.Client public Multimap QueryParameters { get; set; } /// - /// Header parameters to be applied to to the request. + /// Header parameters to be applied to the request. /// Keys may have 1 or more values associated. /// public Multimap HeaderParameters { get; set; } @@ -35,10 +35,12 @@ namespace {{packageName}}.Client /// public Dictionary FormParameters { get; set; } + {{#supportsFileParameters}} /// /// File parameters to be sent along with the request. /// public Multimap FileParameters { get; set; } + {{/supportsFileParameters}} /// /// Cookies to be sent along with the request. @@ -76,7 +78,9 @@ namespace {{packageName}}.Client QueryParameters = new Multimap(); HeaderParameters = new Multimap(); FormParameters = new Dictionary(); + {{#supportsFileParameters}} FileParameters = new Multimap(); + {{/supportsFileParameters}} Cookies = new List(); } } diff --git a/templates/Solution.mustache b/templates/Solution.mustache index c8f0eeb..f558967 100644 --- a/templates/Solution.mustache +++ b/templates/Solution.mustache @@ -4,12 +4,16 @@ VisualStudioVersion = {{^netStandard}}12.0.0.0{{/netStandard}}{{#netStandard}}14 MinimumVisualStudioVersion = {{^netStandard}}10.0.0.1{{/netStandard}}{{#netStandard}}10.0.40219.1{{/netStandard}} Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "src\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" EndProject +{{^useCustomTemplateCode}} {{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "src\{{testPackageName}}\{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject -{{/excludeTests}} +{{/excludeTests}}Global +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dropbox.Sign.Test", "src\Dropbox.Sign.Test\Dropbox.Sign.Test.csproj", "{C305EB17-93FE-4BDA-89A4-120BD8C8A88A}" EndProject Global +{{/useCustomTemplateCode}} GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU @@ -23,10 +27,12 @@ Global {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU +{{#useCustomTemplateCode}} {C305EB17-93FE-4BDA-89A4-120BD8C8A88A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C305EB17-93FE-4BDA-89A4-120BD8C8A88A}.Debug|Any CPU.Build.0 = Debug|Any CPU {C305EB17-93FE-4BDA-89A4-120BD8C8A88A}.Release|Any CPU.ActiveCfg = Release|Any CPU {C305EB17-93FE-4BDA-89A4-120BD8C8A88A}.Release|Any CPU.Build.0 = Release|Any CPU +{{/useCustomTemplateCode}} EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/templates/TestProject.mustache b/templates/TestProject.mustache index e5f01e5..05df99a 100644 --- a/templates/TestProject.mustache +++ b/templates/TestProject.mustache @@ -22,10 +22,15 @@ 512 +{{^useCustomTemplateCode}} + +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} - - +{{/useCustomTemplateCode}} + + diff --git a/templates/ValidateRegex.mustache b/templates/ValidateRegex.mustache new file mode 100644 index 0000000..15cf626 --- /dev/null +++ b/templates/ValidateRegex.mustache @@ -0,0 +1,6 @@ +// {{{name}}} ({{{dataType}}}) pattern +Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); +if (!regex{{{name}}}.Match(this.{{{name}}}{{#isUuid}}.ToString(){{/isUuid}}).Success) +{ + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); +} \ No newline at end of file diff --git a/templates/api.mustache b/templates/api.mustache index c19edc2..632833a 100644 --- a/templates/api.mustache +++ b/templates/api.mustache @@ -82,7 +82,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// {{summary}} @@ -100,7 +100,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); {{/operation}} #endregion Asynchronous Operations } @@ -276,6 +276,14 @@ namespace {{packageName}}.{{apiPackage}} {{/allParams}} {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); +{{^useCustomTemplateCode}} + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#bodyParam}} var localVarContentType = ""; var openApiTypes = {{paramName}}.GetOpenApiTypes(); @@ -298,6 +306,7 @@ namespace {{packageName}}.{{apiPackage}} }; var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); {{/bodyParam}} +{{/useCustomTemplateCode}} // to determine the Accept header string[] _accepts = new string[] { @@ -306,6 +315,9 @@ namespace {{packageName}}.{{apiPackage}} {{/produces}} }; +{{^useCustomTemplateCode}} + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); +{{/useCustomTemplateCode}} if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -349,7 +361,7 @@ namespace {{packageName}}.{{apiPackage}} {{#items.vars}} if ({{paramName}}.{{name}} != null) { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); } {{/items.vars}} {{^items}} @@ -377,13 +389,17 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} @@ -395,21 +411,31 @@ namespace {{packageName}}.{{apiPackage}} { {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter {{/isFile}} } {{/required}} {{/formParams}} +{{^useCustomTemplateCode}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} +{{/useCustomTemplateCode}} + localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; localVarRequestOptions.OperationIndex = operationIndex; @@ -516,7 +542,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false);{{/returnType}} @@ -535,7 +561,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { {{#allParams}} {{#required}} @@ -552,6 +578,14 @@ namespace {{packageName}}.{{apiPackage}} {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); +{{^useCustomTemplateCode}} + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} {{#bodyParam}} var localVarContentType = ""; var openApiTypes = {{paramName}}.GetOpenApiTypes(); @@ -572,9 +606,9 @@ namespace {{packageName}}.{{apiPackage}} "{{{mediaType}}}"{{^-last}}, {{/-last}} {{/consumes}} }; - var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); {{/bodyParam}} +{{/useCustomTemplateCode}} // to determine the Accept header string[] _accepts = new string[] { @@ -583,6 +617,9 @@ namespace {{packageName}}.{{apiPackage}} {{/produces}} }; +{{^useCustomTemplateCode}} + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); +{{/useCustomTemplateCode}} if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); @@ -594,6 +631,12 @@ namespace {{packageName}}.{{apiPackage}} localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} {{#pathParams}} {{#required}} localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter @@ -605,17 +648,52 @@ namespace {{packageName}}.{{apiPackage}} } {{/required}} {{/pathParams}} + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} {{#queryParams}} {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} {{/required}} {{^required}} if ({{paramName}} != null) { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{paramName}}[{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}]", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} } {{/required}} {{/queryParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} {{#headerParams}} {{#required}} localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter @@ -631,17 +709,21 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter {{/isFile}} {{/required}} {{^required}} @@ -649,21 +731,31 @@ namespace {{packageName}}.{{apiPackage}} { {{#isFile}} {{#isArray}} + {{#supportsFileParameters}} foreach (var file in {{paramName}}) { localVarRequestOptions.FileParameters.Add("{{baseName}}", file); } + {{/supportsFileParameters}} {{/isArray}} {{^isArray}} + {{#supportsFileParameters}} localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/supportsFileParameters}} {{/isArray}} {{/isFile}} {{^isFile}} - localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#isPrimitiveType}}ParameterToString{{/isPrimitiveType}}{{^isPrimitiveType}}Serialize{{/isPrimitiveType}}({{paramName}})); // form parameter {{/isFile}} } {{/required}} {{/formParams}} +{{^useCustomTemplateCode}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} +{{/useCustomTemplateCode}} + localVarRequestOptions.Operation = "{{classname}}.{{operationId}}"; localVarRequestOptions.OperationIndex = operationIndex; diff --git a/templates/api_doc.mustache b/templates/api_doc.mustache index 24578df..341bd79 100644 --- a/templates/api_doc.mustache +++ b/templates/api_doc.mustache @@ -13,7 +13,7 @@ All URIs are relative to *{{{basePath}}}* {{#operations}} {{#operation}} - + # **{{{operationId}}}** > {{returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) @@ -22,9 +22,91 @@ All URIs are relative to *{{{basePath}}}* {{{.}}}{{/notes}} ### Example +{{^useCustomTemplateCode}} +```csharp +using System.Collections.Generic; +using System.Diagnostics; +{{#useHttpClient}} +using System.Net.Http; +{{/useHttpClient}} +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace Example +{ + public class {{operationId}}Example + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.AddApiKey("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.AddApiKeyPrefix("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + {{#useHttpClient}} + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new {{classname}}(httpClient, config, httpClientHandler); + {{/useHttpClient}} + {{^useHttpClient}} + var apiInstance = new {{classname}}(config); + {{/useHttpClient}} + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.WriteLine(result);{{/returnType}} + } + catch (ApiException e) + { + Debug.Print("Exception when calling {{classname}}.{{operationId}}: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} ```csharp REPLACE_ME_WITH_EXAMPLE_FOR__{{{operationId}}}_C#_CODE ``` +{{/useCustomTemplateCode}} #### Using the {{operationId}}WithHttpInfo variant This returns an ApiResponse object which contains the response data, status code and headers. diff --git a/templates/auth/OAuthAuthenticator.mustache b/templates/auth/OAuthAuthenticator.mustache index cc0b389..d71f262 100644 --- a/templates/auth/OAuthAuthenticator.mustache +++ b/templates/auth/OAuthAuthenticator.mustache @@ -16,6 +16,7 @@ namespace {{packageName}}.Client.Auth readonly string _tokenUrl; readonly string _clientId; readonly string _clientSecret; + readonly string{{nrt?}} _scope; readonly string _grantType; readonly JsonSerializerSettings _serializerSettings; readonly IReadableConfiguration _configuration; @@ -27,6 +28,7 @@ namespace {{packageName}}.Client.Auth string tokenUrl, string clientId, string clientSecret, + string{{nrt?}} scope, OAuthFlow? flow, JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) : base("") @@ -34,6 +36,7 @@ namespace {{packageName}}.Client.Auth _tokenUrl = tokenUrl; _clientId = clientId; _clientSecret = clientSecret; + _scope = scope; _serializerSettings = serializerSettings; _configuration = configuration; @@ -63,7 +66,7 @@ namespace {{packageName}}.Client.Auth /// An authentication parameter. protected override async ValueTask GetAuthenticationParameter(string accessToken) { - var token = string.IsNullOrEmpty(Token) ? await GetToken() : Token; + var token = string.IsNullOrEmpty(Token) ? await GetToken().ConfigureAwait(false) : Token; return new HeaderParameter(KnownHeaders.Authorization, token); } @@ -73,15 +76,31 @@ namespace {{packageName}}.Client.Auth /// An authentication token. async Task GetToken() { - var client = new RestClient(_tokenUrl) - .UseSerializer(() => new CustomJsonCodec(_serializerSettings, _configuration)); + var client = new RestClient(_tokenUrl, + configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(_serializerSettings, _configuration))); var request = new RestRequest() .AddParameter("grant_type", _grantType) .AddParameter("client_id", _clientId) .AddParameter("client_secret", _clientSecret); - var response = await client.PostAsync(request); - return $"{response.TokenType} {response.AccessToken}"; + + if (!string.IsNullOrEmpty(_scope)) + { + request.AddParameter("scope", _scope); + } + + var response = await client.PostAsync(request).ConfigureAwait(false); + + // RFC6749 - token_type is case insensitive. + // RFC6750 - In Authorization header Bearer should be capitalized. + // Fix the capitalization irrespective of token_type casing. + switch (response.TokenType?.ToLower()) + { + case "bearer": + return $"Bearer {response.AccessToken}"; + default: + return $"{response.TokenType} {response.AccessToken}"; + } } } } diff --git a/templates/gitignore.mustache b/templates/gitignore.mustache index 0a5d07c..a41122f 100644 --- a/templates/gitignore.mustache +++ b/templates/gitignore.mustache @@ -27,6 +27,9 @@ x86/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ +{{#useCustomTemplateCode}} +#[Bb]in/ +{{/useCustomTemplateCode}} [Oo]bj/ [Ll]og/ [Ll]ogs/ @@ -360,6 +363,8 @@ MigrationBackup/ # Fody - auto-generated XML schema FodyWeavers.xsd +{{#useCustomTemplateCode}} vendor - +/api .openapi-generator +{{/useCustomTemplateCode}} diff --git a/templates/libraries/generichost/AfterOperationDefaultImplementation.mustache b/templates/libraries/generichost/AfterOperationDefaultImplementation.mustache new file mode 100644 index 0000000..394c657 --- /dev/null +++ b/templates/libraries/generichost/AfterOperationDefaultImplementation.mustache @@ -0,0 +1,2 @@ + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); \ No newline at end of file diff --git a/templates/libraries/generichost/ApiException.mustache b/templates/libraries/generichost/ApiException.mustache index 7777fd0..c14c101 100644 --- a/templates/libraries/generichost/ApiException.mustache +++ b/templates/libraries/generichost/ApiException.mustache @@ -6,7 +6,7 @@ {{/nrt}} using System; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// API Exception @@ -29,7 +29,7 @@ namespace {{packageName}}.Client public string RawContent { get; } /// - /// Construct the ApiException from parts of the reponse + /// Construct the ApiException from parts of the response /// /// /// diff --git a/templates/libraries/generichost/ApiFactory.mustache b/templates/libraries/generichost/ApiFactory.mustache new file mode 100644 index 0000000..a445d21 --- /dev/null +++ b/templates/libraries/generichost/ApiFactory.mustache @@ -0,0 +1,49 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{apiPackage}}; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// An IApiFactory interface + /// + {{>visibility}} interface IApiFactory + { + /// + /// A method to create an IApi of type IResult + /// + /// + /// + IResult Create() where IResult : IApi; + } + + /// + /// An ApiFactory + /// + {{>visibility}} class ApiFactory : IApiFactory + { + /// + /// The service provider + /// + public IServiceProvider Services { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ApiFactory(IServiceProvider services) + { + Services = services; + } + + /// + /// A method to create an IApi of type IResult + /// + /// + /// + public IResult Create() where IResult : IApi + { + return Services.GetRequiredService(); + } + } +} diff --git a/templates/libraries/generichost/ApiKeyToken.mustache b/templates/libraries/generichost/ApiKeyToken.mustache index 25a751a..d3f1f52 100644 --- a/templates/libraries/generichost/ApiKeyToken.mustache +++ b/templates/libraries/generichost/ApiKeyToken.mustache @@ -6,56 +6,51 @@ {{/nrt}} using System; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A token constructed from an apiKey. /// - public class ApiKeyToken : TokenBase + {{>visibility}} class ApiKeyToken : TokenBase { private string _raw; + /// + /// The header that this token will be used with. + /// + public ClientUtils.ApiKeyHeader Header { get; } + /// /// Constructs an ApiKeyToken object. /// /// + /// /// - /// - public ApiKeyToken(string value, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) + /// + public ApiKeyToken(string value, ClientUtils.ApiKeyHeader header, string prefix = "Bearer ", TimeSpan? timeout = null) : base(timeout) { + Header = header; _raw = $"{ prefix }{ value }"; } - /// - /// Places the token in the cookie. - /// - /// - /// - public virtual void UseInCookie(System.Net.Http.HttpRequestMessage request, string cookieName) - { - request.Headers.Add("Cookie", $"{ cookieName }=_raw"); - } - /// /// Places the token in the header. /// /// - /// - public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request) { - request.Headers.Add(headerName, _raw); + request.Headers.Add(ClientUtils.ApiKeyHeaderToString(Header), _raw); } - + /// /// Places the token in the query. /// /// /// /// - /// - public virtual void UseInQuery(System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString, string parameterName) + public virtual void UseInQuery(global::System.Net.Http.HttpRequestMessage request, UriBuilder uriBuilder, System.Collections.Specialized.NameValueCollection parseQueryString) { - parseQueryString[parameterName] = Uri.EscapeDataString(_raw).ToString(){{nrt!}}; + parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(){{nrt!}}; } } } \ No newline at end of file diff --git a/templates/libraries/generichost/ApiResponseEventArgs`1.mustache b/templates/libraries/generichost/ApiResponseEventArgs`1.mustache new file mode 100644 index 0000000..aea35fa --- /dev/null +++ b/templates/libraries/generichost/ApiResponseEventArgs`1.mustache @@ -0,0 +1,24 @@ +using System; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Useful for tracking server health + /// + {{>visibility}} class ApiResponseEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public ApiResponse ApiResponse { get; } + + /// + /// The ApiResponseEventArgs + /// + /// + public ApiResponseEventArgs(ApiResponse apiResponse) + { + ApiResponse = apiResponse; + } + } +} diff --git a/templates/libraries/generichost/ApiResponse`1.mustache b/templates/libraries/generichost/ApiResponse`1.mustache index 1bcf4a8..1b12e41 100644 --- a/templates/libraries/generichost/ApiResponse`1.mustache +++ b/templates/libraries/generichost/ApiResponse`1.mustache @@ -5,64 +5,80 @@ {{/nrt}} using System; -using System.Collections.Generic; +{{^netStandard}} +using System.Diagnostics.CodeAnalysis; +{{/netStandard}} using System.Net; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// Provides a non-generic contract for the ApiResponse wrapper. /// - public interface IApiResponse + {{>visibility}} partial interface IApiResponse { /// - /// The data type of + /// The IsSuccessStatusCode from the api response /// - Type ResponseType { get; } + bool IsSuccessStatusCode { get; } /// - /// Gets or sets the status code (HTTP status code) + /// Gets the status code (HTTP status code) /// /// The status code. HttpStatusCode StatusCode { get; } /// - /// The raw content of this response + /// The raw content of this response. /// string RawContent { get; } - } - /// - /// API Response - /// - {{>visibility}} partial class ApiResponse : IApiResponse - { - #region Properties + /// + /// The DateTime when the request was retrieved. + /// + DateTime DownloadedAt { get; } /// - /// The deserialized content + /// The headers contained in the api response /// - {{! .net 3.1 does not support unconstrained nullable T }} - public T{{#nrt}}{{^netcoreapp3.1}}?{{/netcoreapp3.1}}{{/nrt}} Content { get; set; } + System.Net.Http.Headers.HttpResponseHeaders Headers { get; } /// - /// Gets or sets the status code (HTTP status code) + /// The path used when making the request. /// - /// The status code. - public HttpStatusCode StatusCode { get; } + string Path { get; } /// - /// The content of this response + /// The reason phrase contained in the api response /// - public Type ResponseType - { - get { return typeof(T); } - } + string{{nrt?}} ReasonPhrase { get; } + + /// + /// The DateTime when the request was sent. + /// + DateTime RequestedAt { get; } + + /// + /// The Uri used when making the request. + /// + Uri{{nrt?}} RequestUri { get; } + } + + /// + /// API Response + /// + {{>visibility}} partial class ApiResponse : IApiResponse + { + /// + /// Gets the status code (HTTP status code) + /// + /// The status code. + public HttpStatusCode StatusCode { get; } /// /// The raw data /// - public string RawContent { get; } + public string RawContent { get; protected set; } /// /// The IsSuccessStatusCode from the api response @@ -79,20 +95,76 @@ namespace {{packageName}}.Client /// public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } - #endregion Properties + /// + /// The DateTime when the request was retrieved. + /// + public DateTime DownloadedAt { get; } = DateTime.UtcNow; + + /// + /// The DateTime when the request was sent. + /// + public DateTime RequestedAt { get; } + + /// + /// The path used when making the request. + /// + public string Path { get; } /// - /// Construct the reponse using an HttpResponseMessage + /// The Uri used when making the request. /// - /// + public Uri{{nrt?}} RequestUri { get; } + + /// + /// The + /// + protected System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// /// - public ApiResponse(System.Net.Http.HttpResponseMessage response, string rawContent) + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) { - StatusCode = response.StatusCode; - Headers = response.Headers; - IsSuccessStatusCode = response.IsSuccessStatusCode; - ReasonPhrase = response.ReasonPhrase; + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; RawContent = rawContent; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + } + {{#x-http-statuses-with-return}} + + /// + /// An interface for responses of type {{TType}} + /// + /// + {{>visibility}} interface I{{.}} : IApiResponse + { + /// + /// Deserializes the response if the response is {{.}} + /// + /// + TType {{.}}(); + + /// + /// Returns true if the response is {{.}} and the deserialized response is not null + /// + /// + /// + bool Try{{.}}({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out TType{{nrt?}} result); } + {{/x-http-statuses-with-return}} } diff --git a/templates/libraries/generichost/ApiTestsBase.mustache b/templates/libraries/generichost/ApiTestsBase.mustache index 57dd3c7..3292a1e 100644 --- a/templates/libraries/generichost/ApiTestsBase.mustache +++ b/templates/libraries/generichost/ApiTestsBase.mustache @@ -3,14 +3,15 @@ using System; using System.Collections.Generic; using System.Security.Cryptography; using Microsoft.Extensions.Hosting; -using {{packageName}}.Client;{{#hasImport}} +using {{packageName}}.{{clientPackage}};{{#hasImport}} using {{packageName}}.{{modelPackage}};{{/hasImport}} +using {{packageName}}.Extensions; -{{{testInstructions}}} +{{>testInstructions}} -namespace {{packageName}}.Test.Api +namespace {{packageName}}.Test.{{apiPackage}} { /// /// Base class for API tests @@ -25,23 +26,40 @@ namespace {{packageName}}.Test.Api } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) - .Configure{{apiName}}((context, options) => + .Configure{{apiName}}((context, services, options) => { - {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(apiKeyToken); - {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} - BearerToken bearerToken = new BearerToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(bearerToken); - {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - BasicToken basicToken = new BasicToken(context.Configuration[""], context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(basicToken); - {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} - HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); - HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(httpSignatureToken); - {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OAuthToken oauthToken = new OAuthToken(context.Configuration[""], timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(oauthToken);{{/hasOAuthMethods}} + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + string apiKeyTokenValue{{-index}} = context.Configuration[""] ?? throw new Exception("Token not found."); + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}(apiKeyTokenValue{{-index}}, ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + string bearerTokenValue{{-index}} = context.Configuration[""] ?? throw new Exception("Token not found."); + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}(bearerTokenValue{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + string basicTokenUsername{{-index}} = context.Configuration[""] ?? throw new Exception("Username not found."); + string basicTokenPassword{{-index}} = context.Configuration[""] ?? throw new Exception("Password not found."); + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}(basicTokenUsername{{-index}}, basicTokenPassword{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + string oauthTokenValue{{-index}} = context.Configuration[""] ?? throw new Exception("Token not found."); + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}(oauthTokenValue{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} }); } } diff --git a/templates/libraries/generichost/AsModel.mustache b/templates/libraries/generichost/AsModel.mustache new file mode 100644 index 0000000..96bedfa --- /dev/null +++ b/templates/libraries/generichost/AsModel.mustache @@ -0,0 +1,4 @@ +// This logic may be modified with the AsModel.mustache template +return Is{{vendorExtensions.x-http-status}} + ? System.Text.Json.JsonSerializer.Deserialize<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}>(RawContent, _jsonSerializerOptions) + : {{#net60OrLater}}null{{/net60OrLater}}{{^net60OrLater}}default{{/net60OrLater}}; diff --git a/templates/libraries/generichost/Assembly.mustache b/templates/libraries/generichost/Assembly.mustache new file mode 100644 index 0000000..a22cc23 --- /dev/null +++ b/templates/libraries/generichost/Assembly.mustache @@ -0,0 +1,2 @@ +[assembly: InternalsVisibleTo("{{packageName}}.Test")] + diff --git a/templates/libraries/generichost/BasicToken.mustache b/templates/libraries/generichost/BasicToken.mustache index a8a2b91..ed6f53e 100644 --- a/templates/libraries/generichost/BasicToken.mustache +++ b/templates/libraries/generichost/BasicToken.mustache @@ -9,12 +9,12 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A token constructed from a username and password. /// - public class BasicToken : TokenBase + {{>visibility}} class BasicToken : TokenBase { private string _username; @@ -38,7 +38,7 @@ namespace {{packageName}}.Client /// /// /// - public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) { request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", {{packageName}}.Client.ClientUtils.Base64Encode(_username + ":" + _password)); } diff --git a/templates/libraries/generichost/BearerToken.mustache b/templates/libraries/generichost/BearerToken.mustache index b6062bf..761f598 100644 --- a/templates/libraries/generichost/BearerToken.mustache +++ b/templates/libraries/generichost/BearerToken.mustache @@ -9,12 +9,12 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A token constructed from a token from a bearer token. /// - public class BearerToken : TokenBase + {{>visibility}} class BearerToken : TokenBase { private string _raw; @@ -33,7 +33,7 @@ namespace {{packageName}}.Client /// /// /// - public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) { request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); } diff --git a/templates/libraries/generichost/ClientUtils.mustache b/templates/libraries/generichost/ClientUtils.mustache index 5725652..269d20c 100644 --- a/templates/libraries/generichost/ClientUtils.mustache +++ b/templates/libraries/generichost/ClientUtils.mustache @@ -6,24 +6,21 @@ using System; using System.IO; using System.Linq; -using System.Net.Http; +using System.Collections; +using System.Collections.Generic; using System.Text; using System.Text.Json; -using System.Text.RegularExpressions; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.DependencyInjection;{{#supportsRetry}} -using Polly.Timeout; -using Polly.Extensions.Http; -using Polly;{{/supportsRetry}} -using {{packageName}}.Api;{{#useCompareNetObjects}} +using System.Text.RegularExpressions;{{#useCompareNetObjects}} using KellermanSoftware.CompareNetObjects;{{/useCompareNetObjects}} +using {{packageName}}.{{modelPackage}}; +using System.Runtime.CompilerServices; -namespace {{packageName}}.Client +{{>Assembly}}namespace {{packageName}}.{{clientPackage}} { /// /// Utility functions providing some benefit to API client consumers. /// - public static class ClientUtils + {{>visibility}} static class ClientUtils { {{#useCompareNetObjects}} /// @@ -36,7 +33,11 @@ namespace {{packageName}}.Client /// static ClientUtils() { - compareLogic = new CompareLogic(); + {{#equatable}} + ComparisonConfig comparisonConfig = new{{^net70OrLater}} ComparisonConfig{{/net70OrLater}}(); + comparisonConfig.UseHashCodeIdentifier = true; + {{/equatable}} + compareLogic = new{{^net70OrLater}} CompareLogic{{/net70OrLater}}({{#equatable}}comparisonConfig{{/equatable}}); } {{/useCompareNetObjects}} @@ -49,6 +50,51 @@ namespace {{packageName}}.Client /// public delegate void EventHandler(object sender, T e) where T : EventArgs; + {{#hasApiKeyMethods}} + /// + /// An enum of headers + /// + public enum ApiKeyHeader + { + {{#apiKeyMethods}} + /// + /// The {{keyParamName}} header + /// + {{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}{{^-last}},{{/-last}} + {{/apiKeyMethods}} + } + + /// + /// Converte an ApiKeyHeader to a string + /// + /// + /// + /// + {{>visibility}} static string ApiKeyHeaderToString(ApiKeyHeader value) + { + {{#net80OrLater}} + return value switch + { + {{#apiKeyMethods}} + ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}} => "{{keyParamName}}", + {{/apiKeyMethods}} + _ => throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)), + }; + {{/net80OrLater}} + {{^net80OrLater}} + switch(value) + { + {{#apiKeyMethods}} + case ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}: + return "{{keyParamName}}"; + {{/apiKeyMethods}} + default: + throw new System.ComponentModel.InvalidEnumArgumentException(nameof(value), (int)value, typeof(ApiKeyHeader)); + } + {{/net80OrLater}} + } + + {{/hasApiKeyMethods}} /// /// Returns true when deserialization succeeds. /// @@ -57,7 +103,7 @@ namespace {{packageName}}.Client /// /// /// - public static bool TryDeserialize(string json, JsonSerializerOptions options, {{^netStandard}}[System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/netStandard}}out T{{#nrt}}{{^netStandard}}?{{/netStandard}}{{/nrt}} result) + public static bool TryDeserialize(string json, JsonSerializerOptions options, {{#net60OrLater}}[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/net60OrLater}}out T{{#nrt}}{{#net60OrLater}}?{{/net60OrLater}}{{/nrt}} result) { try { @@ -79,7 +125,7 @@ namespace {{packageName}}.Client /// /// /// - public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, {{^netStandard}}[System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/netStandard}}out T{{#nrt}}{{^netStandard}}?{{/netStandard}}{{/nrt}} result) + public static bool TryDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options, {{#net60OrLater}}[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] {{/net60OrLater}}out T{{#nrt}}{{#net60OrLater}}?{{/net60OrLater}}{{/nrt}} result) { try { @@ -112,7 +158,7 @@ namespace {{packageName}}.Client /// The parameter (header, path, query, form). /// The DateTime serialization format. /// Formatted string. - public static string{{nrt?}} ParameterToString(object obj, string{{nrt?}} format = ISO8601_DATETIME_FORMAT) + public static string{{nrt?}} ParameterToString(object{{nrt?}} obj, string{{nrt?}} format = ISO8601_DATETIME_FORMAT) { if (obj is DateTime dateTime) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat @@ -127,9 +173,45 @@ namespace {{packageName}}.Client // For example: 2009-06-15T13:45:30.0000000 return dateTimeOffset.ToString(format); if (obj is bool boolean) - return boolean ? "true" : "false"; - if (obj is System.Collections.ICollection collection) - return string.Join(",", collection.Cast()); + return boolean + ? "true" + : "false"; + {{#models}} + {{#model}} + {{#isEnum}} + if (obj is {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{classname}}ValueConverter.{{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/isEnum}} + {{^isEnum}} + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} + if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} + if (obj is {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}) + {{! below has #isNumeric as a work around but should probably have ^isString instead https://github.com/OpenAPITools/openapi-generator/issues/15038}} + return {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{{datatypeWithEnum}}}{{/lambda.camelcase_sanitize_param}}){{#isNumeric}}.ToString(){{/isNumeric}}; + {{/complexType}} + {{/isEnum}} + {{/vars}} + {{/isEnum}} + {{/model}} + {{/models}} + if (obj is ICollection collection) + { + List entries = new{{^net70OrLater}} List{{/net70OrLater}}(); + foreach (var entry in collection) + entries.Add(ParameterToString(entry)); + return string.Join(",", entries); + } return Convert.ToString(obj, System.Globalization.CultureInfo.InvariantCulture); } @@ -176,7 +258,7 @@ namespace {{packageName}}.Client /// Encoded string. public static string Base64Encode(string text) { - return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text)); } /// @@ -255,169 +337,65 @@ namespace {{packageName}}.Client } /// - /// The base path of the API - /// - public const string BASE_ADDRESS = "{{{basePath}}}"; - - /// - /// The scheme of the API + /// Get the discriminator /// - public const string SCHEME = "{{{scheme}}}"; - - /// - /// The context path of the API - /// - public const string CONTEXT_PATH = "{{contextPath}}"; - - /// - /// The host of the API - /// - public const string HOST = "{{{host}}}"; - - /// - /// The format to use for DateTime serialization - /// - public const string ISO8601_DATETIME_FORMAT = "o"; - - {{^hasAuthMethods}} - /// - /// Add the api to your host builder. - /// - /// - /// - public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder) + /// + /// + /// + /// + public static string{{nrt?}} GetDiscriminator(Utf8JsonReader utf8JsonReader, string discriminator) { - builder.ConfigureServices((context, services) => - { - HostConfiguration config = new HostConfiguration(services); + int currentDepth = utf8JsonReader.CurrentDepth; - Add{{apiName}}(services, config); - }); + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); - return builder; - } + JsonTokenType startingTokenType = utf8JsonReader.TokenType; - {{/hasAuthMethods}} - /// - /// Add the api to your host builder. - /// - /// - /// - public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder, Action options) - { - builder.ConfigureServices((context, services) => + while (utf8JsonReader.Read()) { - HostConfiguration config = new HostConfiguration(services); + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; - options(context, config); + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string{{nrt?}} localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); - Add{{apiName}}(services, config); - }); + if (localVarJsonPropertyName != null && localVarJsonPropertyName.Equals(discriminator)) + return utf8JsonReader.GetString(); + } + } - return builder; + throw new JsonException("The specified discriminator was not found."); } - {{^hasAuthMethods}} /// - /// Add the api to your host builder. + /// The base path of the API /// - /// - /// - public static void Add{{apiName}}(this IServiceCollection services) - { - HostConfiguration config = new HostConfiguration(services); - Add{{apiName}}(services, config); - } + public const string BASE_ADDRESS = "{{{basePath}}}"; - {{/hasAuthMethods}} /// - /// Add the api to your host builder. + /// The scheme of the API /// - /// - /// - public static void Add{{apiName}}(this IServiceCollection services, Action options) - { - HostConfiguration config = new HostConfiguration(services); - options(config); - Add{{apiName}}(services, config); - } - - private static void Add{{apiName}}(IServiceCollection services, HostConfiguration host) - { - if (!host.HttpClientsAdded) - host.Add{{apiName}}HttpClients(); - - // ensure that a token provider was provided for this token type - // if not, default to RateLimitProvider - var containerServices = services.Where(s => s.ServiceType.IsGenericType && - s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); - - foreach(var containerService in containerServices) - { - var tokenType = containerService.ServiceType.GenericTypeArguments[0]; - - var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); - - if (provider == null) - { - services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); - services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), - s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); - } - } - }{{#supportsRetry}} + public const string SCHEME = "{{{scheme}}}"; /// - /// Adds a Polly retry policy to your clients. + /// The context path of the API /// - /// - /// - /// - public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) - { - client.AddPolicyHandler(RetryPolicy(retries)); - - return client; - } + public const string CONTEXT_PATH = "{{contextPath}}"; /// - /// Adds a Polly timeout policy to your clients. + /// The host of the API /// - /// - /// - /// - public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) - { - client.AddPolicyHandler(TimeoutPolicy(timeout)); - - return client; - } + public const string HOST = "{{{host}}}"; /// - /// Adds a Polly circiut breaker to your clients. + /// The format to use for DateTime serialization /// - /// - /// - /// - /// - public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) - { - client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); - - return client; - } - - private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) - => HttpPolicyExtensions - .HandleTransientHttpError() - .Or() - .RetryAsync(retries); - - private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) - => Policy.TimeoutAsync(timeout); - - private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( - PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) - => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak);{{/supportsRetry}} + public const string ISO8601_DATETIME_FORMAT = "o"; } } diff --git a/templates/libraries/generichost/CookieContainer.mustache b/templates/libraries/generichost/CookieContainer.mustache new file mode 100644 index 0000000..f96d4fb --- /dev/null +++ b/templates/libraries/generichost/CookieContainer.mustache @@ -0,0 +1,22 @@ +// +{{partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System.Linq; +using System.Collections.Generic; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A class containing a CookieContainer + /// + {{>visibility}} sealed class CookieContainer + { + /// + /// The collection of tokens + /// + public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); + } +} \ No newline at end of file diff --git a/templates/libraries/generichost/DateFormats.mustache b/templates/libraries/generichost/DateFormats.mustache new file mode 100644 index 0000000..920ecda --- /dev/null +++ b/templates/libraries/generichost/DateFormats.mustache @@ -0,0 +1,2 @@ + "yyyy'-'MM'-'dd", + "yyyyMMdd" diff --git a/templates/libraries/generichost/DateOnlyJsonConverter.mustache b/templates/libraries/generichost/DateOnlyJsonConverter.mustache new file mode 100644 index 0000000..209979c --- /dev/null +++ b/templates/libraries/generichost/DateOnlyJsonConverter.mustache @@ -0,0 +1,51 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateOnlyJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateFormats}} + }; + + /// + /// Returns a DateOnly from the Json object + /// + /// + /// + /// + /// + public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnly dateOnlyValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateOnlyValue.ToString("{{{dateFormat}}}", CultureInfo.InvariantCulture)); + } +} diff --git a/templates/libraries/generichost/DateOnlyNullableJsonConverter.mustache b/templates/libraries/generichost/DateOnlyNullableJsonConverter.mustache new file mode 100644 index 0000000..17c8473 --- /dev/null +++ b/templates/libraries/generichost/DateOnlyNullableJsonConverter.mustache @@ -0,0 +1,56 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateOnlyNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateFormats}} + }; + + /// + /// Returns a DateOnly from the Json object + /// + /// + /// + /// + /// + public override DateOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateOnly to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateOnly? dateOnlyValue, JsonSerializerOptions options) + { + if (dateOnlyValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateOnlyValue.Value.ToString("{{{dateFormat}}}", CultureInfo.InvariantCulture)); + } + } +} diff --git a/templates/libraries/generichost/DateTimeFormats.mustache b/templates/libraries/generichost/DateTimeFormats.mustache new file mode 100644 index 0000000..85ed99a --- /dev/null +++ b/templates/libraries/generichost/DateTimeFormats.mustache @@ -0,0 +1,22 @@ + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK", + "yyyy'-'MM'-'dd'T'HH':'mm':'ssK", + {{^supportsDateOnly}} + "yyyy'-'MM'-'dd", + {{/supportsDateOnly}} + "yyyyMMddTHHmmss.fffffffK", + "yyyyMMddTHHmmss.ffffffK", + "yyyyMMddTHHmmss.fffffK", + "yyyyMMddTHHmmss.ffffK", + "yyyyMMddTHHmmss.fffK", + "yyyyMMddTHHmmss.ffK", + "yyyyMMddTHHmmss.fK", + "yyyyMMddTHHmmssK", + {{^supportsDateOnly}} + "yyyyMMdd" + {{/supportsDateOnly}} \ No newline at end of file diff --git a/templates/libraries/generichost/DateTimeJsonConverter.mustache b/templates/libraries/generichost/DateTimeJsonConverter.mustache new file mode 100644 index 0000000..c5187f5 --- /dev/null +++ b/templates/libraries/generichost/DateTimeJsonConverter.mustache @@ -0,0 +1,51 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for {{#supportsDateOnly}}'date-time'{{/supportsDateOnly}}{{^supportsDateOnly}}'date' and 'date-time'{{/supportsDateOnly}} openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateTimeJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateTimeFormats}} + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + throw new NotSupportedException(); + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + throw new NotSupportedException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) => + writer.WriteStringValue(dateTimeValue.ToString("{{{dateTimeFormat}}}", CultureInfo.InvariantCulture)); + } +} diff --git a/templates/libraries/generichost/DateTimeNullableJsonConverter.mustache b/templates/libraries/generichost/DateTimeNullableJsonConverter.mustache new file mode 100644 index 0000000..646c729 --- /dev/null +++ b/templates/libraries/generichost/DateTimeNullableJsonConverter.mustache @@ -0,0 +1,56 @@ +{{>partial_header}} +using System; +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Formatter for {{#supportsDateOnly}}'date-time'{{/supportsDateOnly}}{{^supportsDateOnly}}'date' and 'date-time'{{/supportsDateOnly}} openapi formats ss defined by full-date - RFC3339 + /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types + /// + {{>visibility}} class DateTimeNullableJsonConverter : JsonConverter + { + /// + /// The formats used to deserialize the date + /// + public static string[] Formats { get; } = { +{{>DateTimeFormats}} + }; + + /// + /// Returns a DateTime from the Json object + /// + /// + /// + /// + /// + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + string value = reader.GetString(){{nrt!}}; + + foreach(string format in Formats) + if (DateTime.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime result)) + return result; + + return null; + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, DateTime? dateTimeValue, JsonSerializerOptions options) + { + if (dateTimeValue == null) + writer.WriteNullValue(); + else + writer.WriteStringValue(dateTimeValue.Value.ToString("{{{dateTimeFormat}}}", CultureInfo.InvariantCulture)); + } + } +} diff --git a/templates/libraries/generichost/DependencyInjectionTests.mustache b/templates/libraries/generichost/DependencyInjectionTests.mustache index ac4a4d8..aadf2c7 100644 --- a/templates/libraries/generichost/DependencyInjectionTests.mustache +++ b/templates/libraries/generichost/DependencyInjectionTests.mustache @@ -4,104 +4,157 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.DependencyInjection; using System.Collections.Generic; using System.Security.Cryptography; -using {{packageName}}.Client; +using {{packageName}}.{{clientPackage}}; using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Extensions; using Xunit; -namespace {{packageName}}.Test.Api +namespace {{packageName}}.Test.{{apiPackage}} { /// /// Tests the dependency injection. /// public class DependencyInjectionTest { - private readonly IHost _hostUsingConfigureWithoutAClient = - Host.CreateDefaultBuilder(Array.Empty()).Configure{{apiName}}((context, options) => + private readonly IHost _hostUsingConfigureWithoutAClient = + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).Configure{{apiName}}((context, services, options) => { - {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(apiKeyToken); - {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} - BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(bearerToken); - {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(basicToken); - {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} - HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); - HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(httpSignatureToken); - {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(oauthToken);{{/hasOAuthMethods}} + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} }) .Build(); private readonly IHost _hostUsingConfigureWithAClient = - Host.CreateDefaultBuilder(Array.Empty()).Configure{{apiName}}((context, options) => + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).Configure{{apiName}}((context, services, options) => { - {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(apiKeyToken); - {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} - BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(bearerToken); - {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(basicToken); - {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} - HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); - HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(httpSignatureToken); - {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(oauthToken);{{/hasOAuthMethods}} + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} options.Add{{apiName}}HttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); }) .Build(); private readonly IHost _hostUsingAddWithoutAClient = - Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).ConfigureServices((host, services) => { services.Add{{apiName}}(options => { - {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(apiKeyToken); - {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} - BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(bearerToken); - {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(basicToken); - {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} - HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); - HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(httpSignatureToken); - {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(oauthToken);{{/hasOAuthMethods}} + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} }); }) .Build(); private readonly IHost _hostUsingAddWithAClient = - Host.CreateDefaultBuilder(Array.Empty()).ConfigureServices((host, services) => + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).ConfigureServices((host, services) => { services.Add{{apiName}}(options => { - {{#hasApiKeyMethods}}ApiKeyToken apiKeyToken = new ApiKeyToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(apiKeyToken); - {{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} - BearerToken bearerToken = new BearerToken($"", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(bearerToken); - {{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} - BasicToken basicToken = new BasicToken("", "", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(basicToken); - {{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} - HttpSigningConfiguration config = new HttpSigningConfiguration("", "", null, new List(), HashAlgorithmName.SHA256, "", 0); - HttpSignatureToken httpSignatureToken = new HttpSignatureToken(config, timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(httpSignatureToken); - {{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OAuthToken oauthToken = new OAuthToken("token", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(oauthToken);{{/hasOAuthMethods}} + {{#lambda.trimTrailingWithNewLine}} + {{#apiKeyMethods}} + ApiKeyToken apiKeyToken{{-index}} = new{{^net70OrLater}} ApiKeyToken{{/net70OrLater}}("", ClientUtils.ApiKeyHeader.{{#lambda.titlecase}}{{keyParamName}}{{/lambda.titlecase}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(apiKeyToken{{-index}}); + + {{/apiKeyMethods}} + {{#httpBearerMethods}} + BearerToken bearerToken{{-index}} = new{{^net70OrLater}} BearerToken{{/net70OrLater}}("", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(bearerToken{{-index}}); + + {{/httpBearerMethods}} + {{#httpBasicMethods}} + BasicToken basicToken{{-index}} = new{{^net70OrLater}} BasicToken{{/net70OrLater}}("", "", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(basicToken{{-index}}); + + {{/httpBasicMethods}} + {{#httpSignatureMethods}} + HttpSigningConfiguration config{{-index}} = new{{^net70OrLater}} HttpSigningConfiguration{{/net70OrLater}}("", "", null, {{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}new List(){{/net80OrLater}}, HashAlgorithmName.SHA256, "", 0); + HttpSignatureToken httpSignatureToken{{-index}} = new{{^net70OrLater}} HttpSignatureToken{{/net70OrLater}}(config{{-index}}, timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(httpSignatureToken{{-index}}); + + {{/httpSignatureMethods}} + {{#oauthMethods}} + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); + + {{/oauthMethods}} + {{/lambda.trimTrailingWithNewLine}} options.Add{{apiName}}HttpClients(client => client.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS)); }); }) @@ -113,9 +166,9 @@ namespace {{packageName}}.Test.Api [Fact] public void ConfigureApiWithAClientTest() { - {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingConfigureWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); - Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} - + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingConfigureWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + {{/-last}}{{/apis}}{{/apiInfo}} } @@ -125,9 +178,9 @@ namespace {{packageName}}.Test.Api [Fact] public void ConfigureApiWithoutAClientTest() { - {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); - Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} - + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingConfigureWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + {{/-last}}{{/apis}}{{/apiInfo}} } @@ -137,8 +190,8 @@ namespace {{packageName}}.Test.Api [Fact] public void AddApiWithAClientTest() { - {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingAddWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); - Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingAddWithAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} {{/-last}}{{/apis}}{{/apiInfo}} } @@ -149,9 +202,9 @@ namespace {{packageName}}.Test.Api [Fact] public void AddApiWithoutAClientTest() { - {{#apiInfo}}{{#apis}}var {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = _hostUsingAddWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); - Assert.True({{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.HttpClient.BaseAddress != null);{{^-last}} - + {{#apiInfo}}{{#apis}}var {{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}} = _hostUsingAddWithoutAClient.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + Assert.True({{#lambda.camel_case}}{{classname}}{{/lambda.camel_case}}.HttpClient.BaseAddress != null);{{^-last}} + {{/-last}}{{/apis}}{{/apiInfo}} } } diff --git a/templates/libraries/generichost/EnumValueDataType.mustache b/templates/libraries/generichost/EnumValueDataType.mustache new file mode 100644 index 0000000..e92e67b --- /dev/null +++ b/templates/libraries/generichost/EnumValueDataType.mustache @@ -0,0 +1 @@ +{{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}{{^isNumeric}}string{{/isNumeric}}{{/isString}}{{#isNumeric}}{{#isLong}}long{{/isLong}}{{#isFloat}}float{{/isFloat}}{{#isDouble}}double{{/isDouble}}{{#isDecimal}}decimal{{/isDecimal}}{{^isLong}}{{^isFloat}}{{^isDouble}}{{^isDecimal}}int{{/isDecimal}}{{/isDouble}}{{/isFloat}}{{/isLong}}{{/isNumeric}}{{/-first}}{{/enumVars}}{{/allowableValues}} \ No newline at end of file diff --git a/templates/libraries/generichost/ExceptionEventArgs.mustache b/templates/libraries/generichost/ExceptionEventArgs.mustache new file mode 100644 index 0000000..016ef7c --- /dev/null +++ b/templates/libraries/generichost/ExceptionEventArgs.mustache @@ -0,0 +1,24 @@ +using System; + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// Useful for tracking server health + /// + {{>visibility}} class ExceptionEventArgs : EventArgs + { + /// + /// The ApiResponse + /// + public Exception Exception { get; } + + /// + /// The ExcepetionEventArgs + /// + /// + public ExceptionEventArgs(Exception exception) + { + Exception = exception; + } + } +} diff --git a/templates/libraries/generichost/HostConfiguration.mustache b/templates/libraries/generichost/HostConfiguration.mustache index e74707b..d7d1e3b 100644 --- a/templates/libraries/generichost/HostConfiguration.mustache +++ b/templates/libraries/generichost/HostConfiguration.mustache @@ -10,18 +10,18 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Net.Http; using Microsoft.Extensions.DependencyInjection; -using {{packageName}}.Api; -using {{packageName}}.Model; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.{{modelPackage}}; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// Provides hosting configuration for {{packageName}} /// - public class HostConfiguration + {{>visibility}} class HostConfiguration { private readonly IServiceCollection _services; - private JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); + private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); internal bool HttpClientsAdded { get; private set; } @@ -33,30 +33,51 @@ namespace {{packageName}}.Client { _services = services; _jsonOptions.Converters.Add(new JsonStringEnumConverter()); - _jsonOptions.Converters.Add(new OpenAPIDateJsonConverter()); -{{#models}} -{{#model}} -{{^isEnum}} -{{#allOf}} -{{#-first}} + _jsonOptions.Converters.Add(new DateTimeJsonConverter()); + _jsonOptions.Converters.Add(new DateTimeNullableJsonConverter()); + {{#supportsDateOnly}} + _jsonOptions.Converters.Add(new DateOnlyJsonConverter()); + _jsonOptions.Converters.Add(new DateOnlyNullableJsonConverter()); + {{/supportsDateOnly}} + {{#models}} + {{#model}} + {{#isEnum}} + _jsonOptions.Converters.Add(new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter()); + _jsonOptions.Converters.Add(new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter()); + {{/isEnum}} + {{^isEnum}} _jsonOptions.Converters.Add(new {{classname}}JsonConverter()); -{{/-first}} -{{/allOf}} -{{#anyOf}} -{{#-first}} - _jsonOptions.Converters.Add(new {{classname}}JsonConverter()); -{{/-first}} -{{/anyOf}} -{{#oneOf}} -{{#-first}} - _jsonOptions.Converters.Add(new {{classname}}JsonConverter()); -{{/-first}} -{{/oneOf}} -{{/isEnum}} -{{/model}} -{{/models}} - _services.AddSingleton(new JsonSerializerOptionsProvider(_jsonOptions));{{#apiInfo}}{{#apis}} - _services.AddSingleton<{{interfacePrefix}}{{classname}}, {{classname}}>();{{/apis}}{{/apiInfo}} + {{/isEnum}} + {{/model}} + {{/models}} + JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new{{^net60OrLater}} JsonSerializerOptionsProvider{{/net60OrLater}}(_jsonOptions); + _services.AddSingleton(jsonSerializerOptionsProvider); + {{#useSourceGeneration}} + + {{#models}} + {{#-first}} + _jsonOptions.TypeInfoResolver = System.Text.Json.Serialization.Metadata.JsonTypeInfoResolver.Combine( + {{/-first}} + {{/models}} + {{#lambda.joinLinesWithComma}} + {{#models}} + {{#model}} + new {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}SerializationContext(){{#-last}},{{/-last}} + {{/model}} + {{/models}} + {{/lambda.joinLinesWithComma}} + {{#models}} + {{#-last}} + + new System.Text.Json.Serialization.Metadata.DefaultJsonTypeInfoResolver() + ); + {{/-last}} + {{/models}} + + {{/useSourceGeneration}} + _services.AddSingleton();{{#apiInfo}}{{#apis}} + _services.AddSingleton<{{classname}}Events>(); + _services.AddTransient<{{interfacePrefix}}{{classname}}, {{classname}}>();{{/apis}}{{/apiInfo}} } /// @@ -65,17 +86,16 @@ namespace {{packageName}}.Client /// /// /// - public HostConfiguration Add{{apiName}}HttpClients<{{#apiInfo}}{{#apis}}T{{classname}}{{^-last}}, {{/-last}}{{/apis}}> + public HostConfiguration Add{{apiName}}HttpClients ( - Action{{nrt?}} client = null, Action{{nrt?}} builder = null){{#apis}} - where T{{classname}} : class, {{interfacePrefix}}{{classname}}{{/apis}} + Action{{nrt?}} client = null, Action{{nrt?}} builder = null) { if (client == null) client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); List builders = new List(); - - {{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, T{{classname}}>(client)); + + {{#apiInfo}}{{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>(client)); {{/apis}}{{/apiInfo}} if (builder != null) foreach (IHttpClientBuilder instance in builders) @@ -86,19 +106,6 @@ namespace {{packageName}}.Client return this; } - /// - /// Configures the HttpClients. - /// - /// - /// - /// - public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} client = null, Action{{nrt?}} builder = null) - { - Add{{apiName}}HttpClients<{{#apiInfo}}{{#apis}}{{classname}}{{^-last}}, {{/-last}}{{/apis}}{{/apiInfo}}>(client, builder); - - return this; - } - /// /// Configures the JsonSerializerSettings /// diff --git a/templates/libraries/generichost/HttpSigningConfiguration.mustache b/templates/libraries/generichost/HttpSigningConfiguration.mustache index 29ea235..5e0f773 100644 --- a/templates/libraries/generichost/HttpSigningConfiguration.mustache +++ b/templates/libraries/generichost/HttpSigningConfiguration.mustache @@ -13,14 +13,13 @@ using System.Security.Cryptography; using System.Text; using System.Web; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// Class for HttpSigning auth related parameter and methods /// - public class HttpSigningConfiguration + {{>visibility}} class HttpSigningConfiguration { - #region /// /// Create an instance /// @@ -34,9 +33,7 @@ namespace {{packageName}}.Client SigningAlgorithm = signingAlgorithm; SignatureValidityPeriod = signatureValidityPeriod; } - #endregion - #region Properties /// ///Gets the Api keyId /// @@ -72,25 +69,20 @@ namespace {{packageName}}.Client /// public int SignatureValidityPeriod { get; set; } - #endregion - - #region enum private enum PrivateKeyType { None = 0, RSA = 1, ECDSA = 2, } - #endregion - #region Methods /// /// Gets the Headers for HttpSigning /// /// /// /// - internal Dictionary GetHttpSignedHeader(System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken? cancellationToken = null) + internal Dictionary GetHttpSignedHeader(global::System.Net.Http.HttpRequestMessage request, string requestBody, System.Threading.CancellationToken cancellationToken = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) { if (request.RequestUri == null) throw new NullReferenceException("The request URI was null"); @@ -130,12 +122,12 @@ namespace {{packageName}}.Client if (HashAlgorithm == HashAlgorithmName.SHA256) { - var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); digest = string.Format("SHA-256={0}", Convert.ToBase64String(bodyDigest)); } else if (HashAlgorithm == HashAlgorithmName.SHA512) { - var bodyDigest = GetStringHash(HashAlgorithm.ToString(), requestBody); + var bodyDigest = GetStringHash(HashAlgorithm, requestBody); digest = string.Format("SHA-512={0}", Convert.ToBase64String(bodyDigest)); } else @@ -190,9 +182,9 @@ namespace {{packageName}}.Client foreach (var keyVal in httpSignatureHeader) headerValuesList.Add(string.Format("{0}: {1}", keyVal.Key, keyVal.Value)); - //Concatinate headers value separated by new line + //Concatenate headers value separated by new line var headerValuesString = string.Join("\n", headerValuesList); - var signatureStringHash = GetStringHash(HashAlgorithm.ToString(), headerValuesString); + var signatureStringHash = GetStringHash(HashAlgorithm, headerValuesString); string{{nrt?}} headerSignatureStr = null; var keyType = GetKeyType(KeyFilePath); @@ -219,15 +211,27 @@ namespace {{packageName}}.Client return HttpSignedRequestHeader; } - private byte[] GetStringHash(string hashName, string stringToBeHashed) + private byte[] GetStringHash(HashAlgorithmName hashAlgorithmName, string stringToBeHashed) { - var hashAlgorithm = System.Security.Cryptography.HashAlgorithm.Create(hashName); + HashAlgorithm{{nrt?}} hashAlgorithm = null; + + if (hashAlgorithmName == HashAlgorithmName.SHA1) + hashAlgorithm = SHA1.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA256) + hashAlgorithm = SHA256.Create(); + + if (hashAlgorithmName == HashAlgorithmName.SHA512) + hashAlgorithm = SHA512.Create(); + + if (hashAlgorithmName == HashAlgorithmName.MD5) + hashAlgorithm = MD5.Create(); if (hashAlgorithm == null) throw new NullReferenceException($"{ nameof(hashAlgorithm) } was null."); - var bytes = Encoding.UTF8.GetBytes(stringToBeHashed); - var stringHash = hashAlgorithm.ComputeHash(bytes); + byte[] bytes = Encoding.UTF8.GetBytes(stringToBeHashed); + byte[] stringHash = hashAlgorithm.ComputeHash(bytes); return stringHash; } @@ -268,10 +272,9 @@ namespace {{packageName}}.Client /// private string GetECDSASignature(byte[] dataToSign) { + {{#net60OrLater}} if (!File.Exists(KeyFilePath)) - { throw new Exception("key file path does not exist."); - } var ecKeyHeader = "-----BEGIN EC PRIVATE KEY-----"; var ecKeyFooter = "-----END EC PRIVATE KEY-----"; @@ -280,7 +283,6 @@ namespace {{packageName}}.Client var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); var ecdsa = ECDsa.Create(); -#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) var byteCount = 0; if (KeyPassPhrase != null) { @@ -301,24 +303,23 @@ namespace {{packageName}}.Client } } else - { ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); - } + var signedBytes = ecdsa.SignHash(dataToSign); var derBytes = ConvertToECDSAANS1Format(signedBytes); var signedString = System.Convert.ToBase64String(derBytes); return signedString; -#else + {{/net60OrLater}} + {{^net60OrLater}} throw new Exception("ECDSA signing is supported only on NETCOREAPP3_0 and above"); -#endif - + {{/net60OrLater}} } private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); - byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44 + byte derLength = 68; //default length for ECDSA code signing bit 0x44 byte rbytesLength = 32; //R length 0x20 byte sbytesLength = 32; //S length 0x20 var rBytes = new List(); @@ -353,7 +354,7 @@ namespace {{packageName}}.Client } derBytes.Add(48); //start of the sequence 0x30 - derBytes.Add(derLength); //total length r lenth, type and r bytes + derBytes.Add(derLength); //total length r length, type and r bytes derBytes.Add(2); //tag for integer derBytes.Add(rbytesLength); //length of r @@ -365,7 +366,7 @@ namespace {{packageName}}.Client return derBytes.ToArray(); } - private RSACryptoServiceProvider{{nrt?}} GetRSAProviderFromPemFile(String pemfile, SecureString{{nrt?}} keyPassPharse = null) + private RSACryptoServiceProvider{{nrt?}} GetRSAProviderFromPemFile(String pemfile, SecureString{{nrt?}} keyPassPhrase = null) { const String pempubheader = "-----BEGIN PUBLIC KEY-----"; const String pempubfooter = "-----END PUBLIC KEY-----"; @@ -382,7 +383,7 @@ namespace {{packageName}}.Client if (isPrivateKeyFile) { - pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPharse); + pemkey = ConvertPrivateKeyToBytes(pemstr, keyPassPhrase); if (pemkey == null) return null; @@ -392,7 +393,7 @@ namespace {{packageName}}.Client return null; } - private byte[]{{nrt?}} ConvertPrivateKeyToBytes(String instr, SecureString{{nrt?}} keyPassPharse = null) + private byte[]{{nrt?}} ConvertPrivateKeyToBytes(String instr, SecureString{{nrt?}} keyPassPhrase = null) { const String pemprivheader = "-----BEGIN RSA PRIVATE KEY-----"; const String pemprivfooter = "-----END RSA PRIVATE KEY-----"; @@ -412,7 +413,7 @@ namespace {{packageName}}.Client binkey = Convert.FromBase64String(pvkstr); return binkey; } - catch (System.FormatException) + catch (global::System.FormatException) { StringReader str = new StringReader(pvkstr); @@ -439,13 +440,13 @@ namespace {{packageName}}.Client { //should have b64 encrypted RSA key now binkey = Convert.FromBase64String(encryptedstr); } - catch (System.FormatException) - { //data is not in base64 fromat + catch (global::System.FormatException) + { //data is not in base64 format return null; } - // TODO: what do we do here if keyPassPharse is null? - byte[] deskey = GetEncryptedKey(salt, keyPassPharse{{nrt!}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes + // TODO: what do we do here if keyPassPhrase is null? + byte[] deskey = GetEncryptedKey(salt, keyPassPhrase{{nrt!}}, 1, 2); // count=1 (for OpenSSL implementation); 2 iterations to get at least 24 bytes if (deskey == null) return null; @@ -584,7 +585,7 @@ namespace {{packageName}}.Client Array.Copy(salt, 0, data00, psbytes.Length, salt.Length); //concatenate the salt bytes // ---- do multi-hashing and concatenate results D1, D2 ... into keymaterial bytes ---- - MD5 md5 = new MD5CryptoServiceProvider(); + MD5 md5 = MD5.Create(); byte[]{{nrt?}} result = null; byte[] hashtarget = new byte[HASHLENGTH + data00.Length]; //fixed length initial hashtarget @@ -673,6 +674,5 @@ namespace {{packageName}}.Client return keyType; } - #endregion } } diff --git a/templates/libraries/generichost/HttpSigningToken.mustache b/templates/libraries/generichost/HttpSigningToken.mustache index 2247140..881682e 100644 --- a/templates/libraries/generichost/HttpSigningToken.mustache +++ b/templates/libraries/generichost/HttpSigningToken.mustache @@ -9,12 +9,12 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A token constructed from an HttpSigningConfiguration /// - public class HttpSignatureToken : TokenBase + {{>visibility}} class HttpSignatureToken : TokenBase { private HttpSigningConfiguration _configuration; @@ -34,7 +34,7 @@ namespace {{packageName}}.Client /// /// /// - public void UseInHeader(System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken? cancellationToken = null) + public void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string requestBody, CancellationToken cancellationToken = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) { var signedHeaders = _configuration.GetHttpSignedHeader(request, requestBody, cancellationToken); diff --git a/templates/libraries/generichost/IApi.mustache b/templates/libraries/generichost/IApi.mustache index 0191328..af31cff 100644 --- a/templates/libraries/generichost/IApi.mustache +++ b/templates/libraries/generichost/IApi.mustache @@ -1,21 +1,15 @@ using System.Net.Http; -namespace {{packageName}}.Client +namespace {{packageName}}.{{apiPackage}} { /// /// Any Api client /// - public interface {{interfacePrefix}}Api + {{>visibility}} interface {{interfacePrefix}}Api { /// /// The HttpClient /// HttpClient HttpClient { get; } - - /// - /// An event to track the health of the server. - /// If you store these event args, be sure to purge old event args to prevent a memory leak. - /// - event ClientUtils.EventHandler{{nrt?}} ApiResponded; } } \ No newline at end of file diff --git a/templates/libraries/generichost/IHostBuilderExtensions.mustache b/templates/libraries/generichost/IHostBuilderExtensions.mustache new file mode 100644 index 0000000..948f066 --- /dev/null +++ b/templates/libraries/generichost/IHostBuilderExtensions.mustache @@ -0,0 +1,55 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using {{packageName}}.{{clientPackage}}; + +namespace {{packageName}}.Extensions +{ + /// + /// Extension methods for IHostBuilder + /// + {{>visibility}} static class IHostBuilderExtensions + { + {{^hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + IServiceCollectionExtensions.Add{{apiName}}(services, config); + }); + + return builder; + } + + {{/hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + /// + public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder, Action options) + { + builder.ConfigureServices((context, services) => + { + HostConfiguration config = new HostConfiguration(services); + + options(context, services, config); + + IServiceCollectionExtensions.Add{{apiName}}(services, config); + }); + + return builder; + } + } +} diff --git a/templates/libraries/generichost/IHttpClientBuilderExtensions.mustache b/templates/libraries/generichost/IHttpClientBuilderExtensions.mustache new file mode 100644 index 0000000..053c022 --- /dev/null +++ b/templates/libraries/generichost/IHttpClientBuilderExtensions.mustache @@ -0,0 +1,75 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Net.Http; +using Microsoft.Extensions.DependencyInjection;{{#supportsRetry}} +using Polly.Timeout; +using Polly.Extensions.Http; +using Polly;{{/supportsRetry}} + +namespace {{packageName}}.Extensions +{ + /// + /// Extension methods for IHttpClientBuilder + /// + {{>visibility}} static class IHttpClientBuilderExtensions + { + {{#supportsRetry}} + /// + /// Adds a Polly retry policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddRetryPolicy(this IHttpClientBuilder client, int retries) + { + client.AddPolicyHandler(RetryPolicy(retries)); + + return client; + } + + /// + /// Adds a Polly timeout policy to your clients. + /// + /// + /// + /// + public static IHttpClientBuilder AddTimeoutPolicy(this IHttpClientBuilder client, TimeSpan timeout) + { + client.AddPolicyHandler(TimeoutPolicy(timeout)); + + return client; + } + + /// + /// Adds a Polly circuit breaker to your clients. + /// + /// + /// + /// + /// + public static IHttpClientBuilder AddCircuitBreakerPolicy(this IHttpClientBuilder client, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + { + client.AddTransientHttpErrorPolicy(builder => CircuitBreakerPolicy(builder, handledEventsAllowedBeforeBreaking, durationOfBreak)); + + return client; + } + + private static Polly.Retry.AsyncRetryPolicy RetryPolicy(int retries) + => HttpPolicyExtensions + .HandleTransientHttpError() + .Or() + .RetryAsync(retries); + + private static AsyncTimeoutPolicy TimeoutPolicy(TimeSpan timeout) + => Policy.TimeoutAsync(timeout); + + private static Polly.CircuitBreaker.AsyncCircuitBreakerPolicy CircuitBreakerPolicy( + PolicyBuilder builder, int handledEventsAllowedBeforeBreaking, TimeSpan durationOfBreak) + => builder.CircuitBreakerAsync(handledEventsAllowedBeforeBreaking, durationOfBreak); + {{/supportsRetry}} + } +} diff --git a/templates/libraries/generichost/IServiceCollectionExtensions.mustache b/templates/libraries/generichost/IServiceCollectionExtensions.mustache new file mode 100644 index 0000000..14184ac --- /dev/null +++ b/templates/libraries/generichost/IServiceCollectionExtensions.mustache @@ -0,0 +1,69 @@ +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} +using System; +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.{{clientPackage}}; + +namespace {{packageName}}.Extensions +{ + /// + /// Extension methods for IServiceCollection + /// + {{>visibility}} static class IServiceCollectionExtensions + { + {{^hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + public static void Add{{apiName}}(this IServiceCollection services) + { + HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); + Add{{apiName}}(services, config); + } + + {{/hasAuthMethods}} + /// + /// Add the api to your host builder. + /// + /// + /// + public static void Add{{apiName}}(this IServiceCollection services, Action options) + { + HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); + options(config); + Add{{apiName}}(services, config); + } + + internal static void Add{{apiName}}(IServiceCollection services, HostConfiguration host) + { + if (!host.HttpClientsAdded) + host.Add{{apiName}}HttpClients(); + + services.AddSingleton(); + + // ensure that a token provider was provided for this token type + // if not, default to RateLimitProvider + var containerServices = services.Where(s => s.ServiceType.IsGenericType && + s.ServiceType.GetGenericTypeDefinition().IsAssignableFrom(typeof(TokenContainer<>))).ToArray(); + + foreach(var containerService in containerServices) + { + var tokenType = containerService.ServiceType.GenericTypeArguments[0]; + + var provider = services.FirstOrDefault(s => s.ServiceType.IsAssignableFrom(typeof(TokenProvider<>).MakeGenericType(tokenType))); + + if (provider == null) + { + services.AddSingleton(typeof(RateLimitProvider<>).MakeGenericType(tokenType)); + services.AddSingleton(typeof(TokenProvider<>).MakeGenericType(tokenType), + s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); + } + } + } + } +} diff --git a/templates/libraries/generichost/ImplementsIEquatable.mustache b/templates/libraries/generichost/ImplementsIEquatable.mustache new file mode 100644 index 0000000..dd576dd --- /dev/null +++ b/templates/libraries/generichost/ImplementsIEquatable.mustache @@ -0,0 +1 @@ +{{#equatable}}{{#readOnlyVars}}{{#-first}}IEquatable<{{classname}}{{nrt?}}> {{/-first}}{{/readOnlyVars}}{{/equatable}} \ No newline at end of file diff --git a/templates/libraries/generichost/ImplementsValidatable.mustache b/templates/libraries/generichost/ImplementsValidatable.mustache new file mode 100644 index 0000000..7c3f0e0 --- /dev/null +++ b/templates/libraries/generichost/ImplementsValidatable.mustache @@ -0,0 +1 @@ +{{#validatable}}IValidatableObject {{/validatable}} \ No newline at end of file diff --git a/templates/libraries/generichost/JsonConverter.mustache b/templates/libraries/generichost/JsonConverter.mustache index 0a0f754..189acfd 100644 --- a/templates/libraries/generichost/JsonConverter.mustache +++ b/templates/libraries/generichost/JsonConverter.mustache @@ -1,131 +1,648 @@ /// - /// A Json converter for type {{classname}} + /// A Json converter for type /// - public class {{classname}}JsonConverter : JsonConverter<{{classname}}> + {{>visibility}} class {{classname}}JsonConverter : JsonConverter<{{classname}}> { + {{#allVars}} + {{#isDateTime}} /// - /// Returns a boolean if the type is compatible with this converter. + /// The format to use to serialize {{name}} /// - /// - /// - public override bool CanConvert(Type typeToConvert) => typeof({{classname}}).IsAssignableFrom(typeToConvert); + public static string {{name}}Format { get; set; } = "{{{dateTimeFormat}}}"; + + {{/isDateTime}} + {{#isDate}} + /// + /// The format to use to serialize {{name}} + /// + public static string {{name}}Format { get; set; } = "{{{dateFormat}}}"; + {{/isDate}} + {{/allVars}} /// - /// A Json reader. + /// Deserializes json to /// - /// + /// /// - /// + /// /// /// - public override {{classname}} Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override {{classname}} Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) { - int currentDepth = reader.CurrentDepth; + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.trimLineBreaks}} + int currentDepth = utf8JsonReader.CurrentDepth; - if (reader.TokenType != JsonTokenType.StartObject) + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) throw new JsonException(); - {{#composedSchemas.anyOf}} - Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = reader; - bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, options, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}); - - {{/composedSchemas.anyOf}} - {{#composedSchemas.oneOf}} - Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = reader; - bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, options, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}); - - {{/composedSchemas.oneOf}} - {{#composedSchemas.allOf}} - {{^isInherited}} - Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = reader; - bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, options, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}); + JsonTokenType startingTokenType = utf8JsonReader.TokenType; - {{/isInherited}} - {{/composedSchemas.allOf}} {{#allVars}} - {{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = default; + Option<{{#isInnerEnum}}{{^isMap}}{{classname}}.{{/isMap}}{{/isInnerEnum}}{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = default; + {{#-last}} + + {{/-last}} {{/allVars}} + {{#discriminator}} + {{#children}} + {{#-first}} + string{{nrt?}} discriminator = ClientUtils.GetDiscriminator(utf8JsonReader, "{{discriminator.propertyBaseName}}"); + + {{/-first}} + if (discriminator != null && discriminator.Equals("{{name}}")) + return JsonSerializer.Deserialize<{{{name}}}>(ref utf8JsonReader, jsonSerializerOptions) ?? throw new JsonException("The result was an unexpected value."); + + {{/children}} + {{/discriminator}} + {{#model.discriminator}} + {{#model.hasDiscriminatorWithNonEmptyMapping}} + {{#mappedModels}} + {{#model}} + {{^vendorExtensions.x-duplicated-data-type}} + {{classname}}{{nrt?}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}} = null; + {{#-last}} + + {{/-last}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/model}} + {{/mappedModels}} + Utf8JsonReader utf8JsonReaderDiscriminator = utf8JsonReader; + while (utf8JsonReaderDiscriminator.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; - while (reader.Read()) + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderDiscriminator.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth) + break; + + if (utf8JsonReaderDiscriminator.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderDiscriminator.CurrentDepth - 1) + { + string{{nrt?}} localVarJsonPropertyName = utf8JsonReaderDiscriminator.GetString(); + utf8JsonReaderDiscriminator.Read(); + if (localVarJsonPropertyName{{nrt?}}.Equals("{{propertyBaseName}}"){{#nrt}} ?? false{{/nrt}}) + { + string{{nrt?}} discriminator = utf8JsonReaderDiscriminator.GetString(); + {{#mappedModels}} + if (discriminator{{nrt?}}.Equals("{{mappingName}}"){{#nrt}} ?? false{{/nrt}}) + { + Utf8JsonReader utf8JsonReader{{model.classname}} = utf8JsonReader; + {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}} = JsonSerializer.Deserialize<{{{model.classname}}}>(ref utf8JsonReader{{model.classname}}, jsonSerializerOptions); + } + {{/mappedModels}} + } + } + } + + {{/model.hasDiscriminatorWithNonEmptyMapping}} + {{/model.discriminator}} + {{^model.discriminator}} + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = default; + {{#-last}} + + Utf8JsonReader utf8JsonReaderOneOf = utf8JsonReader; + while (utf8JsonReaderOneOf.Read()) { - if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth) + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderOneOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderOneOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderOneOf.CurrentDepth) break; - if (reader.TokenType == JsonTokenType.PropertyName) + if (utf8JsonReaderOneOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderOneOf.CurrentDepth - 1) { - string{{nrt?}} propertyName = reader.GetString(); - reader.Read(); + {{#oneOf}} + Utf8JsonReader utf8JsonReader{{name}} = utf8JsonReader; + ClientUtils.TryDeserialize<{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}>(ref utf8JsonReader{{name}}, jsonSerializerOptions, out {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + {{^-last}} - switch (propertyName) + {{/-last}} + {{/oneOf}} + } + } + {{/-last}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/oneOf}} + + {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = default; + {{#-last}} + + Utf8JsonReader utf8JsonReaderAnyOf = utf8JsonReader; + while (utf8JsonReaderAnyOf.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReaderAnyOf.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReaderAnyOf.CurrentDepth) + break; + + if (utf8JsonReaderAnyOf.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReaderAnyOf.CurrentDepth - 1) + { + {{#anyOf}} + Utf8JsonReader utf8JsonReader{{name}} = utf8JsonReader; + ClientUtils.TryDeserialize<{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}>(ref utf8JsonReader{{name}}, jsonSerializerOptions, out {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + {{^-last}} + + {{/-last}} + {{/anyOf}} + } + } + {{/-last}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/anyOf}} + + {{/composedSchemas}} + {{/model.discriminator}} + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string{{nrt?}} localVarJsonPropertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (localVarJsonPropertyName) { {{#allVars}} case "{{baseName}}": {{#isString}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetString(); + {{^isMap}} + {{^isEnum}} + {{^isUuid}} + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetString(){{^isNullable}}{{nrt!}}{{/isNullable}}); + {{/isUuid}} + {{/isEnum}} + {{/isMap}} {{/isString}} {{#isBoolean}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetBoolean(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetBoolean()); {{/isBoolean}} + {{#isNumeric}} + {{^isEnum}} + {{#isDouble}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDouble()); + {{/isDouble}} {{#isDecimal}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetDecimal(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDecimal()); {{/isDecimal}} - {{#isNumeric}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetInt32(); - {{/isNumeric}} + {{#isFloat}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}(float)utf8JsonReader.GetDouble()); + {{/isFloat}} {{#isLong}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetInt64(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64()); {{/isLong}} - {{#isDouble}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetDouble(); + {{^isLong}} + {{^isFloat}} + {{^isDecimal}} + {{^isDouble}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); {{/isDouble}} + {{/isDecimal}} + {{/isFloat}} + {{/isLong}} + {{/isEnum}} + {{/isNumeric}} {{#isDate}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetDateTime(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); {{/isDate}} {{#isDateTime}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = reader.GetDateTime(); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); {{/isDateTime}} + {{#isEnum}} + {{^isMap}} + {{#isNumeric}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}})utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); + {{/isNumeric}} + {{^isNumeric}} + string{{nrt?}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = utf8JsonReader.GetString(); + {{^isInnerEnum}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{{datatypeWithEnum}}}ValueConverter.FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue)); + {{/isInnerEnum}} + {{#isInnerEnum}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{classname}}.{{{datatypeWithEnum}}}FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue)); + {{/isInnerEnum}} + {{/isNumeric}} + {{/isMap}} + {{/isEnum}} + {{#isUuid}} + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetGuid()); + {{/isUuid}} + {{^isUuid}} + {{^isEnum}} {{^isString}} {{^isBoolean}} - {{^isDecimal}} {{^isNumeric}} - {{^isLong}} - {{^isDouble}} {{^isDate}} {{^isDateTime}} - {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref reader, options); + if (utf8JsonReader.TokenType != JsonTokenType.Null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions){{^isNullable}}{{nrt!}}{{/isNullable}}); {{/isDateTime}} {{/isDate}} - {{/isDouble}} - {{/isLong}} {{/isNumeric}} - {{/isDecimal}} {{/isBoolean}} {{/isString}} + {{/isEnum}} + {{/isUuid}} break; {{/allVars}} + default: + break; } } } - {{#composedSchemas.oneOf}} - if ({{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized) - return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}} {{#model.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/isInherited}}{{/model.composedSchemas.allOf}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} {{/allVars}}{{/lambda.joinWithComma}}); + {{#allVars}} + {{#required}} + if (!{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.IsSet) + throw new ArgumentException("Property is required for class {{classname}}.", nameof({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}})); + + {{/required}} + {{/allVars}} + {{#allVars}} + {{^isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.IsSet && {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.Value == null) + throw new ArgumentNullException(nameof({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}), "Property is not nullable for class {{classname}}."); + + {{/isNullable}} + {{/allVars}} + {{^vendorExtensions.x-duplicated-data-type}} + {{#model.discriminator}} + {{#model.hasDiscriminatorWithNonEmptyMapping}} + {{#mappedModels}} + if ({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}} != null) + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); {{#-last}} throw new JsonException(); {{/-last}} - {{/composedSchemas.oneOf}} + {{/mappedModels}} + {{/model.hasDiscriminatorWithNonEmptyMapping}} + {{/model.discriminator}} {{^composedSchemas.oneOf}} - return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}} {{/model.composedSchemas.anyOf}}{{#model.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}} {{/isInherited}}{{/model.composedSchemas.allOf}}{{#allVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} {{/allVars}}{{/lambda.joinWithComma}}); + {{^required}} + {{#model.composedSchemas.anyOf}} + Option<{{baseType}}{{>NullConditionalProperty}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null + ? default + : new Option<{{baseType}}{{>NullConditionalProperty}}>({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + {{/model.composedSchemas.anyOf}} + {{#-last}} + + {{/-last}} + {{/required}} + return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue{{#required}}.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/required}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); + {{/composedSchemas.oneOf}} + {{^model.discriminator}} + {{#composedSchemas}} + {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} != null) + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}ParsedValue{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); + + {{/vendorExtensions.x-duplicated-data-type}} + {{#-last}} + throw new JsonException(); + {{/-last}} + {{/oneOf}} + {{/composedSchemas}} + {{/model.discriminator}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/lambda.trimLineBreaks}} + {{/lambda.trimTrailingWithNewLine}} + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) + { + {{#lambda.trimLineBreaks}} + {{#lambda.copy}} + {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}} + {{/lambda.copy}} + {{#discriminator}} + {{#children}} + if ({{#lambda.pasteLine}}{{/lambda.pasteLine}} is {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}){ + JsonSerializer.Serialize<{{{name}}}>(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); + return; + } + + {{/children}} + {{/discriminator}} + writer.WriteStartObject(); + + {{#model.discriminator}} + {{#model.hasDiscriminatorWithNonEmptyMapping}} + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + {{#isPrimitiveType}} + {{#isString}} + writer.WriteString("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value); + {{/isString}} + {{#isBoolean}} + writer.WriteBoolean("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isBoolean}} + {{#isNumeric}} + writer.WriteNumber("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isNumeric}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + { + {{baseType}}JsonConverter {{#lambda.camelcase_sanitize_param}}{{baseType}}JsonConverter{{/lambda.camelcase_sanitize_param}} = ({{baseType}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.GetType())); + {{#lambda.camelcase_sanitize_param}}{{baseType}}JsonConverter{{/lambda.camelcase_sanitize_param}}.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + {{/isPrimitiveType}} + + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} + {{/model.hasDiscriminatorWithNonEmptyMapping}} + {{/model.discriminator}} + {{^model.discriminator}} + {{#composedSchemas}} + {{#anyOf}} + if ({{#lambda.joinWithAmpersand}}{{^required}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet {{/required}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}} != null{{/lambda.joinWithAmpersand}}) + {{#isPrimitiveType}} + {{#isString}} + writer.WriteString("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value); + {{/isString}} + {{#isBoolean}} + writer.WriteBoolean("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isBoolean}} + {{#isNumeric}} + writer.WriteNumber("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); + {{/isNumeric}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + { + {{datatypeWithEnum}}JsonConverter {{datatypeWithEnum}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); + {{datatypeWithEnum}}JsonConverter.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); + } + {{/isPrimitiveType}} + + {{/anyOf}} + {{/composedSchemas}} + {{/model.discriminator}} + WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); + writer.WriteEndObject(); + {{/lambda.trimLineBreaks}} } /// - /// A Json writer + /// Serializes the properties of /// /// - /// - /// + /// + /// /// - public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_param}}{{classname}}{{/lambda.camelcase_param}}, JsonSerializerOptions options) => throw new NotImplementedException(); + public void WriteProperties(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) + { + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.trimLineBreaks}} + {{#allVars}} + {{^isDiscriminator}} + {{^isNullable}} + {{#vendorExtensions.x-is-reference-type}} + if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) + throw new ArgumentNullException(nameof({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}), "Property is required for class {{classname}}."); + + {{/vendorExtensions.x-is-reference-type}} + {{/isNullable}} + {{/isDiscriminator}} + {{/allVars}} + {{#allVars}} + {{#isDiscriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} + writer.WriteString("{{baseName}}", {{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{/isEnum}}{{#isNew}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}.Value{{/required}}){{/isEnum}}{{/isNew}}); + + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/isDiscriminator}} + {{^isDiscriminator}} + {{#isString}} + {{^isMap}} + {{^isEnum}} + {{^isUuid}} + {{#lambda.copy}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isUuid}} + {{/isEnum}} + {{/isMap}} + {{/isString}} + {{#isBoolean}} + {{#lambda.copy}} + writer.WriteBoolean("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isBoolean}} + {{^isEnum}} + {{#isNumeric}} + {{#lambda.copy}} + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isNumeric}} + {{/isEnum}} + {{#isDate}} + {{#lambda.copy}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isDate}} + {{#isDateTime}} + {{#lambda.copy}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isDateTime}} + {{#isEnum}} + {{#isNumeric}} + {{#lambda.copy}} + writer.WriteNumber("{{baseName}}", {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}})); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isNumeric}} + {{^isMap}} + {{^isNumeric}} + {{#isInnerEnum}} + {{#isNullable}} + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); + else + writer.WriteNull("{{baseName}}"); + + {{/isNullable}} + {{^isNullable}} + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{classname}}.{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}{{nrt!}}.Value{{/isNullable}}{{/required}}); + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); + {{/isNullable}} + {{/isInnerEnum}} + {{^isInnerEnum}} + {{#lambda.copy}} + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} + {{/lambda.copy}} + {{#required}} + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) + writer.WriteNull("{{baseName}}"); + else + { + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.Value); + {{#allowableValues}} + {{#enumVars}} + {{#-first}} + {{#isString}} + if ({{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue != null){{! we cant use name here because enumVar also has a name property, so use the paste lambda instead }} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{nameInPascalCase}}{{/lambda.camelcase_sanitize_param}}RawValue); + else + writer.WriteNull("{{baseName}}"); + {{/isString}} + {{^isString}} + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{nameInPascalCase}}{{/lambda.camelcase_sanitize_param}}RawValue); + {{/isString}} + {{/-first}} + {{/enumVars}} + {{/allowableValues}} + } + {{/isNullable}} + {{^isNullable}} + var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); + {{#allowableValues}} + {{#enumVars}} + {{#-first}} + {{^isNumeric}} + writer.WriteString("{{baseName}}", {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue); + {{/isNumeric}} + {{#isNumeric}} + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{#lambda.pasteLine}}{{/lambda.pasteLine}}{{/lambda.camelcase_sanitize_param}}RawValue); + {{/isNumeric}} + {{/-first}} + {{/enumVars}} + {{/allowableValues}} + {{/isNullable}} + + {{/required}} + {{^required}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option{{nrt!}}.Value != null) + { + var {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value{{nrt!}}.Value); + writer.{{#lambda.first}}{{#allowableValues}}{{#enumVars}}{{^isNumeric}}WriteString {{/isNumeric}}{{#isNumeric}}WriteNumber {{/isNumeric}}{{/enumVars}}{{/allowableValues}}{{/lambda.first}}("{{baseName}}", {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue); + } + else + writer.WriteNull("{{baseName}}"); + {{/isNullable}} + {{^isNullable}} + { + var {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue = {{{datatypeWithEnum}}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{nrt!}}.Value); + writer.{{#lambda.first}}{{#allowableValues}}{{#enumVars}}{{^isNumeric}}WriteString {{/isNumeric}}{{#isNumeric}}WriteNumber {{/isNumeric}}{{/enumVars}}{{/allowableValues}}{{/lambda.first}}("{{baseName}}", {{#lambda.pasteLine}}{{/lambda.pasteLine}}RawValue); + } + {{/isNullable}} + {{/required}} + {{/isInnerEnum}} + {{/isNumeric}} + {{/isMap}} + {{/isEnum}} + {{#isUuid}} + {{#lambda.copy}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); + {{/lambda.copy}} + {{#lambda.indent3}} + {{>WriteProperty}} + {{/lambda.indent3}} + {{/isUuid}} + {{^isUuid}} + {{^isEnum}} + {{^isString}} + {{^isBoolean}} + {{^isNumeric}} + {{^isDate}} + {{^isDateTime}} + {{#required}} + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} != null) + { + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + else + writer.WriteNull("{{baseName}}"); + {{/isNullable}} + {{^isNullable}} + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + {{/isNullable}} + {{/required}} + {{^required}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value != null) + { + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + else + writer.WriteNull("{{baseName}}"); + {{/isNullable}} + {{^isNullable}} + { + writer.WritePropertyName("{{baseName}}"); + JsonSerializer.Serialize(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}, jsonSerializerOptions); + } + {{/isNullable}} + {{/required}} + {{/isDateTime}} + {{/isDate}} + {{/isNumeric}} + {{/isBoolean}} + {{/isString}} + {{/isEnum}} + {{/isUuid}} + {{/isDiscriminator}} + {{/allVars}} + {{/lambda.trimLineBreaks}} + {{/lambda.trimTrailingWithNewLine}} + } } \ No newline at end of file diff --git a/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache b/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache index 4b28944..93f8054 100644 --- a/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache +++ b/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache @@ -6,12 +6,12 @@ {{/nrt}} using System.Text.Json; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// Provides the JsonSerializerOptions /// - public class JsonSerializerOptionsProvider + {{>visibility}} class JsonSerializerOptionsProvider { /// /// the JsonSerializerOptions diff --git a/templates/libraries/generichost/ModelBaseSignature.mustache b/templates/libraries/generichost/ModelBaseSignature.mustache new file mode 100644 index 0000000..909a68e --- /dev/null +++ b/templates/libraries/generichost/ModelBaseSignature.mustache @@ -0,0 +1 @@ +{{#parentModel.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{parent}}{{/lambda.camelcase_sanitize_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#isInherited}}{{^isNew}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/isNew}}{{#isNew}}{{#isEnum}}{{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^required}}.Value{{/required}}){{/isEnum}}{{^isEnum}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.ToString(){{/isEnum}}{{/isNew}} {{/isInherited}}{{/isDiscriminator}}{{/allVars}} \ No newline at end of file diff --git a/templates/libraries/generichost/ModelSignature.mustache b/templates/libraries/generichost/ModelSignature.mustache new file mode 100644 index 0000000..39aa11f --- /dev/null +++ b/templates/libraries/generichost/ModelSignature.mustache @@ -0,0 +1 @@ +{{#model.allVars}}{{^isDiscriminator}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}{{#defaultValue}} = {{^required}}default{{/required}}{{#required}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{.}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/required}}{{/defaultValue}}{{^defaultValue}}{{#lambda.first}}{{#isNullable}} = default {{/isNullable}}{{^required}} = default {{/required}}{{/lambda.first}}{{/defaultValue}} {{/isDiscriminator}}{{/model.allVars}} diff --git a/templates/libraries/generichost/OAuthToken.mustache b/templates/libraries/generichost/OAuthToken.mustache index b5410ea..23b3cab 100644 --- a/templates/libraries/generichost/OAuthToken.mustache +++ b/templates/libraries/generichost/OAuthToken.mustache @@ -9,12 +9,12 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A token constructed with OAuth. /// - public class OAuthToken : TokenBase + {{>visibility}} class OAuthToken : TokenBase { private string _raw; @@ -33,7 +33,7 @@ namespace {{packageName}}.Client /// /// /// - public virtual void UseInHeader(System.Net.Http.HttpRequestMessage request, string headerName) + public virtual void UseInHeader(global::System.Net.Http.HttpRequestMessage request, string headerName) { request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); } diff --git a/templates/libraries/generichost/OnDeserializationError.mustache b/templates/libraries/generichost/OnDeserializationError.mustache new file mode 100644 index 0000000..ff83a50 --- /dev/null +++ b/templates/libraries/generichost/OnDeserializationError.mustache @@ -0,0 +1,2 @@ +if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); \ No newline at end of file diff --git a/templates/libraries/generichost/OnErrorDefaultImplementation.mustache b/templates/libraries/generichost/OnErrorDefaultImplementation.mustache new file mode 100644 index 0000000..7af8e07 --- /dev/null +++ b/templates/libraries/generichost/OnErrorDefaultImplementation.mustache @@ -0,0 +1,2 @@ + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); \ No newline at end of file diff --git a/templates/libraries/generichost/OperationSignature.mustache b/templates/libraries/generichost/OperationSignature.mustache new file mode 100644 index 0000000..caa9d14 --- /dev/null +++ b/templates/libraries/generichost/OperationSignature.mustache @@ -0,0 +1 @@ +{{#lambda.joinWithComma}}{{#allParams}}{{#required}}{{{dataType}}}{{>NullConditionalParameter}}{{/required}}{{^required}}Option<{{{dataType}}}{{>NullConditionalParameter}}>{{/required}} {{paramName}}{{#notRequiredOrIsNullable}} = default{{/notRequiredOrIsNullable}} {{/allParams}}System.Threading.CancellationToken cancellationToken = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}{{/lambda.joinWithComma}} \ No newline at end of file diff --git a/templates/libraries/generichost/Option.mustache b/templates/libraries/generichost/Option.mustache new file mode 100644 index 0000000..eed4914 --- /dev/null +++ b/templates/libraries/generichost/Option.mustache @@ -0,0 +1,47 @@ +// +{{>partial_header}} +{{#nrt}} +#nullable enable + +{{/nrt}} + +namespace {{packageName}}.{{clientPackage}} +{ + /// + /// A wrapper for operation parameters which are not required + /// + public struct Option + { + /// + /// The value to send to the server + /// + public TType Value { get; } + + /// + /// When true the value will be sent to the server + /// + internal bool IsSet { get; } + + /// + /// A wrapper for operation parameters which are not required + /// + /// + public Option(TType value) + { + IsSet = true; + Value = value; + } + + /// + /// Implicitly converts this option to the contained type + /// + /// + public static implicit operator TType(Option option) => option.Value; + + /// + /// Implicitly converts the provided value to an Option + /// + /// + public static implicit operator Option(TType value) => new Option(value); + } +} \ No newline at end of file diff --git a/templates/libraries/generichost/OptionProperty.mustache b/templates/libraries/generichost/OptionProperty.mustache new file mode 100644 index 0000000..d750418 --- /dev/null +++ b/templates/libraries/generichost/OptionProperty.mustache @@ -0,0 +1 @@ +new Option<{{#isInnerEnum}}{{^isMap}}{{classname}}.{{/isMap}}{{/isInnerEnum}}{{{datatypeWithEnum}}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}>( \ No newline at end of file diff --git a/templates/libraries/generichost/README.client.mustache b/templates/libraries/generichost/README.client.mustache new file mode 100644 index 0000000..371b9da --- /dev/null +++ b/templates/libraries/generichost/README.client.mustache @@ -0,0 +1,245 @@ +# Created with Openapi Generator + + +## Run the following powershell command to generate the library + +```ps1 +$properties = @( + 'apiName={{apiName}}', + 'targetFramework={{targetFramework}}', + 'validatable={{validatable}}', + 'nullableReferenceTypes={{nullableReferenceTypes}}', + 'hideGenerationTimestamp={{hideGenerationTimestamp}}', + 'packageVersion={{packageVersion}}', + 'packageAuthors={{packageAuthors}}', + 'packageCompany={{packageCompany}}', + 'packageCopyright={{packageCopyright}}', + 'packageDescription={{packageDescription}}',{{#licenseId}} + 'licenseId={{.}}',{{/licenseId}} + 'packageName={{packageName}}', + 'packageTags={{packageTags}}', + 'packageTitle={{packageTitle}}' +) -join "," + +$global = @( + 'apiDocs={{generateApiDocs}}', + 'modelDocs={{generateModelDocs}}', + 'apiTests={{generateApiTests}}', + 'modelTests={{generateModelTests}}' +) -join "," + +java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` + -g csharp-netcore ` + -i .yaml ` + -o ` + --library generichost ` + --additional-properties $properties ` + --global-property $global ` + --git-host "{{gitHost}}" ` + --git-repo-id "{{gitRepoId}}" ` + --git-user-id "{{gitUserId}}" ` + --release-note "{{releaseNote}}" + # -t templates +``` + + +## Using the library in your project + +```cs +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.DependencyInjection; +using {{packageName}}.Api; +using {{packageName}}.Client; +using {{packageName}}.Model; + +namespace YourProject +{ + public class Program + { + public static async Task Main(string[] args) + { + var host = CreateHostBuilder(args).Build();{{#apiInfo}}{{#apis}}{{#-first}} + var api = host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); + {{#operations}} + {{#-first}} + {{#operation}} + {{#-first}} + {{operationId}}ApiResponse apiResponse = await api.{{operationId}}Async("todo"); + {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}} model = apiResponse.Ok(); + {{/-first}} + {{/operation}} + {{/-first}} + {{/operations}} + {{/-first}} + {{/apis}} + {{/apiInfo}} + } + + public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .Configure{{apiName}}((context, options) => + { + {{#authMethods}} + {{#-first}} + // the type of token here depends on the api security specifications + ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, ApiKeyToken>(); + + {{/-first}} + {{/authMethods}} + options.ConfigureJsonOptions((jsonOptions) => + { + // your custom converters if any + }); + + options.Add{{apiName}}HttpClients(builder: builder => builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) + // add whatever middleware you prefer + ); + }); + } +} +``` + +## Questions + +- What about HttpRequest failures and retries? + If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. +- How are tokens used? + Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. + Other providers can be used with the UseProvider method. +- Does an HttpRequest throw an error when the server response is not Ok? + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + StatusCode and ReasonPhrase will contain information about the error. + If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. +- How do I validate requests and process responses? + Use the provided On and After methods in the Api class from the namespace {{packageName}}.Rest.DefaultApi. + Or provide your own class by using the generic Configure{{apiName}} method. + + +## Dependencies + +- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later +- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later{{#supportsRetry}} +- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later{{/supportsRetry}}{{#useCompareNetObjects}} +- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later{{/useCompareNetObjects}}{{#validatable}} +- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later{{/validatable}}{{#apiDocs}} + + +## 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}}{{{summary}}}{{/summary}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}{{/apiDocs}}{{#modelDocs}} + + +## Documentation for Models + +{{#modelPackage}}{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md){{/model}}{{/models}}{{/modelPackage}} +{{^modelPackage}}No model defined in this package{{/modelPackage}}{{/modelDocs}} + + +## 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}} +{{#isBasicBasic}} +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} +- **Type**: Bearer Authentication +{{/isBasicBearer}} +{{#isHttpSignature}} +- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}} +- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}}{{#scopes}} +- {{scope}}: {{description}}{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Build +- SDK version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} +- Build package: {{generatorClass}} + +## Api Information +- appName: {{appName}} +- appVersion: {{appVersion}} +- appDescription: {{appDescription}} + +## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) +- generateAliasAsModel: {{generateAliasAsModel}} +- supportingFiles: {{supportingFiles}} +- models: omitted for brevity +- apis: omitted for brevity +- apiDocs: {{generateApiDocs}} +- modelDocs: {{generateModelDocs}} +- apiTests: {{generateApiTests}} +- modelTests: {{generateModelTests}} + +## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) +- allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}} +- apiName: {{apiName}} +- caseInsensitiveResponseHeaders: {{caseInsensitiveResponseHeaders}} +- conditionalSerialization: {{conditionalSerialization}} +- disallowAdditionalPropertiesIfNotPresent: {{disallowAdditionalPropertiesIfNotPresent}} +- gitHost: {{gitHost}} +- gitRepoId: {{gitRepoId}} +- gitUserId: {{gitUserId}} +- hideGenerationTimestamp: {{hideGenerationTimestamp}} +- interfacePrefix: {{interfacePrefix}} +- library: {{library}} +- licenseId: {{licenseId}} +- modelPropertyNaming: {{modelPropertyNaming}} +- netCoreProjectFile: {{netCoreProjectFile}} +- nonPublicApi: {{nonPublicApi}} +- nullableReferenceTypes: {{nullableReferenceTypes}} +- optionalAssemblyInfo: {{optionalAssemblyInfo}} +- optionalEmitDefaultValues: {{optionalEmitDefaultValues}} +- optionalMethodArgument: {{optionalMethodArgument}} +- optionalProjectFile: {{optionalProjectFile}} +- packageAuthors: {{packageAuthors}} +- packageCompany: {{packageCompany}} +- packageCopyright: {{packageCopyright}} +- packageDescription: {{packageDescription}} +- packageGuid: {{packageGuid}} +- packageName: {{packageName}} +- packageTags: {{packageTags}} +- packageTitle: {{packageTitle}} +- packageVersion: {{packageVersion}} +- releaseNote: {{releaseNote}} +- returnICollection: {{returnICollection}} +- sortParamsByRequiredFlag: {{sortParamsByRequiredFlag}} +- sourceFolder: {{sourceFolder}} +- targetFramework: {{targetFramework}} +- useCollection: {{useCollection}} +- useDateTimeOffset: {{useDateTimeOffset}} +- useOneOfDiscriminatorLookup: {{useOneOfDiscriminatorLookup}} +- validatable: {{validatable}}{{#infoUrl}} +For more information, please visit [{{{.}}}]({{{.}}}){{/infoUrl}} + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/templates/libraries/generichost/README.solution.mustache b/templates/libraries/generichost/README.solution.mustache new file mode 100644 index 0000000..f9c1c7f --- /dev/null +++ b/templates/libraries/generichost/README.solution.mustache @@ -0,0 +1 @@ +# Created with Openapi Generator diff --git a/templates/libraries/generichost/README.test.mustache b/templates/libraries/generichost/README.test.mustache new file mode 100644 index 0000000..e69de29 diff --git a/templates/libraries/generichost/RateLimitProvider`1.mustache b/templates/libraries/generichost/RateLimitProvider`1.mustache index 944c006..857a505 100644 --- a/templates/libraries/generichost/RateLimitProvider`1.mustache +++ b/templates/libraries/generichost/RateLimitProvider`1.mustache @@ -4,22 +4,20 @@ #nullable enable {{/nrt}} -using System;{{^netStandard}} -using System.Threading.Channels;{{/netStandard}}{{#netStandard}} -using System.Collections.Concurrent; +using System; +using System.Collections.Generic; using System.Linq; -using System.Threading; -using System.Threading.Tasks;{{/netStandard}} +using System.Threading.Channels; -namespace {{packageName}}.Client {{^netStandard}} +namespace {{packageName}}.{{clientPackage}} { /// /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. /// /// - public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase + {{>visibility}} class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - internal Channel AvailableTokens { get; } + internal Dictionary> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary>{{/net70OrLater}}(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -30,79 +28,49 @@ namespace {{packageName}}.Client {{^netStandard}} foreach(TTokenBase token in _tokens) token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); - BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) - { - FullMode = BoundedChannelFullMode.DropWrite + {{#lambda.copy}} + BoundedChannelOptions options = new BoundedChannelOptions(_tokens.Length) + { + FullMode = BoundedChannelFullMode.DropWrite }; - AvailableTokens = Channel.CreateBounded(options); - - for (int i = 0; i < _tokens.Length; i++) - _tokens[i].TokenBecameAvailable += ((sender) => AvailableTokens.Writer.TryWrite((TTokenBase) sender)); - } - - internal override async System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null) - => await AvailableTokens.Reader.ReadAsync(cancellation.GetValueOrDefault()).ConfigureAwait(false); - } -} {{/netStandard}}{{#netStandard}} -{ - /// - /// Provides a token to the api clients. Tokens will be rate limited based on the provided TimeSpan. - /// - /// - public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase - { - internal ConcurrentDictionary AvailableTokens = new ConcurrentDictionary(); - private SemaphoreSlim _semaphore; - - /// - /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. - /// - /// - public RateLimitProvider(TokenContainer container) : base(container.Tokens) - { - _semaphore = new SemaphoreSlim(1, 1); - - foreach(TTokenBase token in _tokens) - token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); - - for (int i = 0; i < _tokens.Length; i++) + AvailableTokens.Add(string.Empty, Channel.CreateBounded(options)); + {{/lambda.copy}} + {{#hasApiKeyMethods}} + if (container is TokenContainer apiKeyTokenContainer) { - _tokens[i].TokenBecameAvailable += ((sender) => - { - TTokenBase token = (TTokenBase)sender; - - AvailableTokens.TryAdd(token, token); - }); - } - } - - internal override async System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null) - { - await _semaphore.WaitAsync().ConfigureAwait(false); + string[] headers = apiKeyTokenContainer.Tokens.Select(t => ClientUtils.ApiKeyHeaderToString(t.Header)).Distinct().ToArray(); - try - { - TTokenBase result = null; - - while (result == null) + foreach (string header in headers) { - TTokenBase tokenToRemove = AvailableTokens.FirstOrDefault().Value; - - if (tokenToRemove != null && AvailableTokens.TryRemove(tokenToRemove, out result)) - return result; + BoundedChannelOptions options = new BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header))) + { + FullMode = BoundedChannelFullMode.DropWrite + }; - await Task.Delay(40).ConfigureAwait(false); - - tokenToRemove = AvailableTokens.FirstOrDefault().Value; + AvailableTokens.Add(header, Channel.CreateBounded(options)); } - - return result; } - finally + else { - _semaphore.Release(); + {{#lambda.indent1}}{{#lambda.pasteLine}}{{/lambda.pasteLine}}{{/lambda.indent1}} } + {{/hasApiKeyMethods}} + {{^hasApiKeyMethods}} + {{#lambda.pasteLine}}{{/lambda.pasteLine}} + {{/hasApiKeyMethods}} + + foreach(Channel tokens in AvailableTokens.Values) + for (int i = 0; i < _tokens.Length; i++) + _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + } + + internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) + { + if (!AvailableTokens.TryGetValue(header, out Channel{{nrt?}} tokens)) + throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); + + return await tokens.Reader.ReadAsync(cancellation).ConfigureAwait(false); } } -} {{/netStandard}} +} diff --git a/templates/libraries/generichost/SourceGenerationContext.mustache b/templates/libraries/generichost/SourceGenerationContext.mustache new file mode 100644 index 0000000..b1798c9 --- /dev/null +++ b/templates/libraries/generichost/SourceGenerationContext.mustache @@ -0,0 +1,9 @@ +{{#useSourceGeneration}} + + /// + /// The {{classname}}SerializationContext + /// + [JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof({{classname}}))] + {{>visibility}} partial class {{classname}}SerializationContext : JsonSerializerContext { } +{{/useSourceGeneration}} \ No newline at end of file diff --git a/templates/libraries/generichost/TokenBase.mustache b/templates/libraries/generichost/TokenBase.mustache index fd720d1..05f06b4 100644 --- a/templates/libraries/generichost/TokenBase.mustache +++ b/templates/libraries/generichost/TokenBase.mustache @@ -6,12 +6,12 @@ {{/nrt}} using System; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// The base for all tokens. /// - public abstract class TokenBase + {{>visibility}} abstract class TokenBase { private DateTime _nextAvailable = DateTime.UtcNow; private object _nextAvailableLock = new object(); @@ -64,7 +64,7 @@ namespace {{packageName}}.Client _nextAvailable = DateTime.UtcNow.AddSeconds(5); } - private void OnTimer(object sender, System.Timers.ElapsedEventArgs e) + private void OnTimer(object{{nrt?}} sender, System.Timers.ElapsedEventArgs e) { if (TokenBecameAvailable != null && !IsRateLimited) TokenBecameAvailable.Invoke(this); diff --git a/templates/libraries/generichost/TokenContainer`1.mustache b/templates/libraries/generichost/TokenContainer`1.mustache index 9d74224..24c84a5 100644 --- a/templates/libraries/generichost/TokenContainer`1.mustache +++ b/templates/libraries/generichost/TokenContainer`1.mustache @@ -7,13 +7,13 @@ using System.Linq; using System.Collections.Generic; -namespace {{packageName}}.Client +namespace {{packageName}}.{{clientPackage}} { /// /// A container for a collection of tokens. /// /// - public sealed class TokenContainer where TTokenBase : TokenBase + {{>visibility}} sealed class TokenContainer where TTokenBase : TokenBase { /// /// The collection of tokens @@ -31,7 +31,7 @@ namespace {{packageName}}.Client /// Instantiates a TokenContainer /// /// - public TokenContainer(System.Collections.Generic.IEnumerable tokens) + public TokenContainer(global::System.Collections.Generic.IEnumerable tokens) { Tokens = tokens.ToList(); } diff --git a/templates/libraries/generichost/TokenProvider`1.mustache b/templates/libraries/generichost/TokenProvider`1.mustache index cc8bbd7..7226551 100644 --- a/templates/libraries/generichost/TokenProvider`1.mustache +++ b/templates/libraries/generichost/TokenProvider`1.mustache @@ -7,21 +7,21 @@ using System; using System.Linq; using System.Collections.Generic; -using {{packageName}}.Client; +using {{packageName}}.{{clientPackage}}; namespace {{packageName}} { /// /// A class which will provide tokens. /// - public abstract class TokenProvider where TTokenBase : TokenBase + {{>visibility}} abstract class TokenProvider where TTokenBase : TokenBase { /// /// The array of tokens. /// protected TTokenBase[] _tokens; - internal abstract System.Threading.Tasks.ValueTask GetAsync(System.Threading.CancellationToken? cancellation = null); + internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}); /// /// Instantiates a TokenProvider. diff --git a/templates/libraries/generichost/ValidateRegex.mustache b/templates/libraries/generichost/ValidateRegex.mustache new file mode 100644 index 0000000..78aba8f --- /dev/null +++ b/templates/libraries/generichost/ValidateRegex.mustache @@ -0,0 +1,7 @@ +// {{{name}}} ({{{dataType}}}) pattern +Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); +{{#lambda.copy}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null && {{/lambda.copy}} +if ({{#lambda.first}}{{^required}}{{#lambda.pasteLine}}{{/lambda.pasteLine}} {{/required}}{{#isNullable}}{{#lambda.pasteLine}}{{/lambda.pasteLine}}{{/isNullable}}{{/lambda.first}}!regex{{{name}}}.Match(this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}}{{#isUuid}}.ToString(){{#lambda.first}}{{^required}}{{nrt!}} {{/required}}{{#isNullable}}! {{/isNullable}}{{/lambda.first}}{{/isUuid}}).Success) +{ + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); +} \ No newline at end of file diff --git a/templates/libraries/generichost/WriteProperty.mustache b/templates/libraries/generichost/WriteProperty.mustache new file mode 100644 index 0000000..99659ac --- /dev/null +++ b/templates/libraries/generichost/WriteProperty.mustache @@ -0,0 +1,9 @@ +{{#required}} +{{>WritePropertyHelper}} +{{/required}} +{{^required}} +if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) + {{#lambda.indent1}} + {{>WritePropertyHelper}} + {{/lambda.indent1}} +{{/required}} \ No newline at end of file diff --git a/templates/libraries/generichost/WritePropertyHelper.mustache b/templates/libraries/generichost/WritePropertyHelper.mustache new file mode 100644 index 0000000..183946c --- /dev/null +++ b/templates/libraries/generichost/WritePropertyHelper.mustache @@ -0,0 +1,9 @@ +{{#isNullable}} +if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}} != null) + {{#lambda.pasteLine}}{{/lambda.pasteLine}} +else + writer.WriteNull("{{baseName}}"); +{{/isNullable}} +{{^isNullable}} +{{#lambda.pasteLine}}{{/lambda.pasteLine}} +{{/isNullable}} \ No newline at end of file diff --git a/templates/libraries/generichost/api.mustache b/templates/libraries/generichost/api.mustache index 5e2bb67..8c02da8 100644 --- a/templates/libraries/generichost/api.mustache +++ b/templates/libraries/generichost/api.mustache @@ -1,3 +1,4 @@ +{{#lambda.trimLineBreaks}} // {{>partial_header}} {{#nrt}} @@ -6,25 +7,45 @@ {{/nrt}} using System; using System.Collections.Generic; +{{#net80OrLater}} +{{#lambda.uniqueLines}} +{{#operations}} +{{#operation}} +{{#vendorExtensions.x-set-cookie}} +using System.Linq; +{{/vendorExtensions.x-set-cookie}} +{{/operation}} +{{/operations}} +{{/lambda.uniqueLines}} +{{/net80OrLater}} using System.Net; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using System.Net.Http; using System.Net.Http.Headers; using System.Text.Json; -using {{packageName}}.Client; +using {{packageName}}.{{clientPackage}}; {{#hasImport}} using {{packageName}}.{{modelPackage}}; {{/hasImport}} +{{^netStandard}} +using System.Diagnostics.CodeAnalysis; +{{/netStandard}} namespace {{packageName}}.{{apiPackage}} { {{#operations}} /// /// Represents a collection of functions to interact with the API endpoints + /// This class is registered as transient. /// {{>visibility}} interface {{interfacePrefix}}{{classname}} : IApi { + /// + /// The class containing the events + /// + {{classname}}Events Events { get; } + {{#operation}} /// /// {{summary}} @@ -34,11 +55,14 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task<ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>> - Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null); + /// <> + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}); /// /// {{summary}} @@ -46,44 +70,95 @@ namespace {{packageName}}.{{apiPackage}} /// /// {{notes}} /// - /// Thrown when fails to make API call {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}> - Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}Async({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null);{{#nrt}} + /// <{{nrt?}}> + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}); + {{^-last}} + {{/-last}} + {{/operation}} + } + {{#operation}} + {{#responses}} + {{#-first}} + + /// + /// The + /// + {{>visibility}} interface {{interfacePrefix}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} + { + {{#responses}} + {{#vendorExtensions.x-http-status-is-default}} /// - /// {{summary}} + /// Returns true if the response is the default response type /// - /// - /// {{notes}} - /// - {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} - {{/allParams}} - /// Cancellation Token to cancel the request. - /// Task of ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}object{{/returnType}}?> - Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null); + /// + bool Is{{vendorExtensions.x-http-status}} { get; } + {{/vendorExtensions.x-http-status-is-default}} + {{^vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + bool Is{{vendorExtensions.x-http-status}} { get; } + {{/vendorExtensions.x-http-status-is-default}} + {{^-last}} - {{/nrt}}{{^-last}} {{/-last}} + {{/responses}} + } + {{/-first}} + {{/responses}} + {{/operation}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} class {{classname}}Events + { + {{#lambda.trimTrailingWithNewLine}} + {{#operation}} + /// + /// The event raised after the server response + /// + public event EventHandler{{nrt?}} On{{operationId}}; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler{{nrt?}} OnError{{operationId}}; + + internal void ExecuteOn{{operationId}}({{classname}}.{{operationId}}ApiResponse apiResponse) + { + On{{operationId}}?.Invoke(this, new ApiResponseEventArgs(apiResponse)); + } + + internal void ExecuteOnError{{operationId}}(Exception exception) + { + OnError{{operationId}}?.Invoke(this, new ExceptionEventArgs(exception)); + } + {{/operation}} + {{/lambda.trimTrailingWithNewLine}} } /// /// Represents a collection of functions to interact with the API endpoints /// - {{>visibility}} partial class {{classname}} : {{interfacePrefix}}{{classname}} + {{>visibility}} sealed partial class {{classname}} : {{interfacePrefix}}{{classname}} { private JsonSerializerOptions _jsonSerializerOptions; /// - /// An event to track the health of the server. - /// If you store these event args, be sure to purge old event args to prevent a memory leak. + /// The logger factory /// - public event ClientUtils.EventHandler{{nrt?}} ApiResponded; + public ILoggerFactory LoggerFactory { get; } /// /// The logger @@ -93,7 +168,12 @@ namespace {{packageName}}.{{apiPackage}} /// /// The HttpClient /// - public HttpClient HttpClient { get; }{{#hasApiKeyMethods}} + public HttpClient HttpClient { get; } + + /// + /// The class containing the events + /// + public {{classname}}Events Events { get; }{{#hasApiKeyMethods}} /// /// A token provider of type @@ -120,106 +200,154 @@ namespace {{packageName}}.{{apiPackage}} /// public TokenProvider OauthTokenProvider { get; }{{/hasOAuthMethods}} + {{#net80OrLater}} + {{#lambda.unique}} + {{#operation}} + {{#vendorExtensions.x-set-cookie}} + /// + /// The token cookie container + /// + public {{packageName}}.{{clientPackage}}.CookieContainer CookieContainer { get; } + + {{/vendorExtensions.x-set-cookie}} + {{/operation}} + {{/lambda.unique}} + {{/net80OrLater}} /// /// Initializes a new instance of the class. /// /// - public {{classname}}(ILogger<{{classname}}> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider{{#hasApiKeyMethods}}, - TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, - TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, - TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, - TokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, - TokenProvider oauthTokenProvider{{/hasOAuthMethods}}) + public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, + TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, + TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, + TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, + TokenProvider httpSignatureTokenProvider{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}}, + TokenProvider oauthTokenProvider{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}}, + {{packageName}}.{{clientPackage}}.CookieContainer cookieContainer{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}}) { _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; - Logger = logger; - HttpClient = httpClient;{{#hasApiKeyMethods}} + LoggerFactory = loggerFactory; + Logger = LoggerFactory.CreateLogger<{{classname}}>(); + HttpClient = httpClient; + Events = {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}};{{#hasApiKeyMethods}} ApiKeyProvider = apiKeyProvider;{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} BearerTokenProvider = bearerTokenProvider;{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}} BasicTokenProvider = basicTokenProvider;{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}} HttpSignatureTokenProvider = httpSignatureTokenProvider;{{/hasHttpSignatureMethods}}{{#hasOAuthMethods}} - OauthTokenProvider = oauthTokenProvider;{{/hasOAuthMethods}} + OauthTokenProvider = oauthTokenProvider;{{/hasOAuthMethods}}{{#net80OrLater}}{{#operation}}{{#lambda.uniqueLines}}{{#vendorExtensions.x-set-cookie}} + CookieContainer = cookieContainer;{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}} } {{#operation}} + {{#allParams}} + {{#-first}} + partial void Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + + {{/-first}} + {{/allParams}} + {{#vendorExtensions.x-has-not-nullable-reference-types}} /// - /// {{summary}} {{notes}} + /// Validates the request parameters /// - /// Thrown when fails to make API call + {{#vendorExtensions.x-not-nullable-reference-types}} + /// + {{/vendorExtensions.x-not-nullable-reference-types}} + /// + private void Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}) + { + {{#lambda.trimTrailingWithNewLine}} + {{#vendorExtensions.x-not-nullable-reference-types}} + {{#required}} + {{^vendorExtensions.x-is-value-type}} + if ({{paramName}} == null) + throw new ArgumentNullException(nameof({{paramName}})); + + {{/vendorExtensions.x-is-value-type}} + {{/required}} + {{^required}} + {{^vendorExtensions.x-is-value-type}} + if ({{paramName}}.IsSet && {{paramName}}.Value == null) + throw new ArgumentNullException(nameof({{paramName}})); + + {{/vendorExtensions.x-is-value-type}} + {{/required}} + {{/vendorExtensions.x-not-nullable-reference-types}} + {{/lambda.trimTrailingWithNewLine}} + } + + {{/vendorExtensions.x-has-not-nullable-reference-types}} + /// + /// Processes the server response + /// + /// {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// {{/allParams}} - /// Cancellation Token to cancel the request. - /// <> - public async Task<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}Async({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); - - {{^nrt}}{{#returnTypeIsPrimitive}}#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - {{/returnTypeIsPrimitive}}{{/nrt}}if (result.Content == null){{^nrt}}{{#returnTypeIsPrimitive}} - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'{{/returnTypeIsPrimitive}}{{/nrt}} - throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); - - return result.Content; + bool suppressDefaultLog = false; + After{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); +{{>AfterOperationDefaultImplementation}} } - {{#nrt}} /// - /// {{summary}} {{notes}} + /// Processes the server response /// - /// Thrown when fails to make API call + /// + /// {{#allParams}} - /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + /// {{/allParams}} - /// Cancellation Token to cancel the request. - /// <> - public async Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) - { - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>{{nrt?}} result = null; - try - { - result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); - } - catch (Exception) - { - } + partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); - return result != null && result.IsSuccessStatusCode - ? result.Content - : null; + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + {{#allParams}} + /// + {{/allParams}} + private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + { + bool suppressDefaultLog = false; + OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog exception pathFormat path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); +{{>OnErrorDefaultImplementation}} } - {{/nrt}} - {{^nrt}} - {{^returnTypeIsPrimitive}} - {{! Note that this method is a copy paste of above due to NRT complexities }} + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + {{#allParams}} + /// + {{/allParams}} + partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + /// /// {{summary}} {{notes}} /// - /// Thrown when fails to make API call {{#allParams}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} /// Cancellation Token to cancel the request. - /// <> - public async Task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> {{operationId}}OrDefaultAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + /// <> + public async Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}) { - ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>{{nrt?}} result = null; - try + try { - result = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); + return await {{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); } catch (Exception) { + return null; } - - return result != null && result.IsSuccessStatusCode - ? result.Content - : null; } - {{/returnTypeIsPrimitive}} - {{/nrt}} /// /// {{summary}} {{notes}} /// @@ -228,179 +356,444 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} /// Cancellation Token to cancel the request. - /// <> where T : - public async Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{^required}}{{{dataType}}} {{paramName}} = null{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken? cancellationToken = null) + /// <> + public async Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}) { + {{#lambda.trimLineBreaks}} + UriBuilder uriBuilderLocalVar = new UriBuilder(); + try { - {{#hasRequiredParams}}#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'{{/hasRequiredParams}}{{#allParams}}{{#required}}{{#nrt}} - - if ({{paramName}} == null) - throw new ArgumentNullException(nameof({{paramName}}));{{/nrt}}{{^nrt}}{{^vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-has-not-nullable-reference-types}} + Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}); - if ({{paramName}} == null) - throw new ArgumentNullException(nameof({{paramName}}));{{/vendorExtensions.x-csharp-value-type}}{{/nrt}}{{/required}}{{/allParams}}{{#hasRequiredParams}} + {{/vendorExtensions.x-has-not-nullable-reference-types}} + {{#allParams}} + {{#-first}} + Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' - - {{/hasRequiredParams}}using (HttpRequestMessage request = new HttpRequestMessage()) + {{/-first}} + {{/allParams}} + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) { - UriBuilder uriBuilder = new UriBuilder(); - uriBuilder.Host = HttpClient.BaseAddress{{nrt!}}.Host; - uriBuilder.Port = HttpClient.BaseAddress{{nrt!}}.Port; - uriBuilder.Scheme = ClientUtils.SCHEME; - uriBuilder.Path = ClientUtils.CONTEXT_PATH + "{{path}}";{{#pathParams}}{{#required}} - uriBuilder.Path = uriBuilder.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString()));{{/required}}{{^required}} - - if ({{paramName}} != null) - uriBuilder.Path = uriBuilder.Path + $"/{ Uri.EscapeDataString({{paramName}}).ToString()) }"; - {{/required}}{{/pathParams}}{{#queryParams}}{{#-first}} - - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);{{/-first}}{{/queryParams}}{{^queryParams}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} - - System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}{{/queryParams}}{{#queryParams}}{{#required}}{{#-first}} - - {{! all the redundant tags here are to get the spacing just right }} - {{/-first}}{{/required}}{{/queryParams}}{{#queryParams}}{{#required}}parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{nrt!}}); - {{/required}}{{/queryParams}}{{#queryParams}}{{#-first}} - {{/-first}}{{/queryParams}}{{#queryParams}}{{^required}}if ({{paramName}} != null) - parseQueryString["{{baseName}}"] = Uri.EscapeDataString({{paramName}}.ToString(){{nrt!}}); - - {{/required}}{{#-last}}uriBuilder.Query = parseQueryString.ToString();{{/-last}}{{/queryParams}}{{#headerParams}}{{#required}} - - request.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}));{{/required}}{{^required}} - - if ({{paramName}} != null) - request.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}));{{/required}}{{/headerParams}}{{#formParams}}{{#-first}} - - MultipartContent multipartContent = new MultipartContent(); - - request.Content = multipartContent; - - List> formParams = new List>(); - - multipartContent.Add(new FormUrlEncodedContent(formParams));{{/-first}}{{^isFile}}{{#required}} - - formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}})));{{/required}}{{^required}} - - if ({{paramName}} != null) - formParams.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}})));{{/required}}{{/isFile}}{{#isFile}}{{#required}} - - multipartContent.Add(new StreamContent({{paramName}}));{{/required}}{{^required}} - - if ({{paramName}} != null) - multipartContent.Add(new StreamContent({{paramName}}));{{/required}}{{/isFile}}{{/formParams}}{{#bodyParam}} - - request.Content = ({{paramName}} as object) is System.IO.Stream stream - ? request.Content = new StreamContent(stream) - : request.Content = new StringContent(JsonSerializer.Serialize({{paramName}}, _jsonSerializerOptions));{{/bodyParam}}{{#authMethods}}{{#-first}} - - List tokens = new List();{{/-first}}{{#isApiKey}} - - ApiKeyToken apiKey = (ApiKeyToken) await ApiKeyProvider.GetAsync(cancellationToken).ConfigureAwait(false); - - tokens.Add(apiKey);{{#isKeyInHeader}} - - apiKey.UseInHeader(request, "{{keyParamName}}");{{/isKeyInHeader}}{{#isKeyInQuery}} - - apiKey.UseInQuery(request, uriBuilder, parseQueryString, "{{keyParamName}}"); - - uriBuilder.Query = parseQueryString.ToString();{{/isKeyInQuery}}{{#isKeyInCookie}} - - apiKey.UseInCookie(request, parseQueryString, "{{keyParamName}}"); - - uriBuilder.Query = parseQueryString.ToString();{{/isKeyInCookie}}{{/isApiKey}}{{/authMethods}} - - {{! below line must be after any UseInQuery calls, but before using the HttpSignatureToken}} - request.RequestUri = uriBuilder.Uri;{{#authMethods}}{{#isBasicBasic}} - - BasicToken basicToken = (BasicToken) await BasicTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - - tokens.Add(basicToken); - - basicToken.UseInHeader(request, "{{keyParamName}}");{{/isBasicBasic}}{{#isBasicBearer}} - - BearerToken bearerToken = (BearerToken) await BearerTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); - - tokens.Add(bearerToken); - - bearerToken.UseInHeader(request, "{{keyParamName}}");{{/isBasicBearer}}{{#isOAuth}} + {{^servers}} + uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{path}}"; + {{/servers}} + {{#servers}} + {{#-first}} + Uri urlLocalVar = httpRequestMessageLocalVar.RequestUri = new Uri("{{url}}"); + uriBuilderLocalVar.Host = urlLocalVar.Authority; + uriBuilderLocalVar.Scheme = urlLocalVar.Scheme; + uriBuilderLocalVar.Path = urlLocalVar.AbsolutePath; + {{/-first}} + {{/servers}} + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString(ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}))); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} + {{#pathParams}} + uriBuilderLocalVar.Path = uriBuilderLocalVar.Path.Replace("%7B{{baseName}}%7D", Uri.EscapeDataString({{paramName}}.ToString())); + {{#-last}} + + {{/-last}} + {{/pathParams}} + {{#queryParams}} + {{#-first}} + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + {{/-first}} + {{/queryParams}} + {{^queryParams}} + {{#authMethods}} + {{#isApiKey}} + {{#isKeyInQuery}} + + System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} + {{/queryParams}} + {{#queryParams}} + {{#required}} + {{#-first}} + + {{/-first}} + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}); + {{/required}} + {{/queryParams}} + + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}}); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} + {{#queryParams}} + {{^required}} + if ({{paramName}}.IsSet) + parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}.Value); + + {{/required}} + {{#-last}} + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + + {{/-last}} + {{/queryParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} + {{#headerParams}} + {{#required}} + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}})); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value)); + + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#-first}} + MultipartContent multipartContentLocalVar = new MultipartContent(); + + httpRequestMessageLocalVar.Content = multipartContentLocalVar; + + List> formParameterLocalVars = new List>(); + + multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars));{{/-first}}{{^isFile}}{{#required}} + + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value))); + + {{/required}} + {{/isFile}} + {{#isFile}} + {{#required}} + multipartContentLocalVar.Add(new StreamContent({{paramName}})); + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + multipartContentLocalVar.Add(new StreamContent({{paramName}}.Value)); + + {{/required}} + {{/isFile}} + {{/formParams}} + {{#bodyParam}} + {{#required}} + httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream + ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + {{/required}} + + {{/bodyParam}} + {{#authMethods}} + {{#-first}} + List tokenBaseLocalVars = new List(); + {{/-first}} + {{#isApiKey}} + {{^isKeyInCookie}} + ApiKeyToken apiKeyTokenLocalVar{{-index}} = (ApiKeyToken) await ApiKeyProvider.GetAsync("{{keyParamName}}", cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(apiKeyTokenLocalVar{{-index}}); + {{#isKeyInHeader}} + apiKeyTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar); + + {{/isKeyInHeader}} + {{/isKeyInCookie}} + {{#isKeyInQuery}} + + apiKeyTokenLocalVar{{-index}}.UseInQuery(httpRequestMessageLocalVar, uriBuilderLocalVar, parseQueryStringLocalVar); + + uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + {{#authMethods}} + {{#isBasicBasic}} + + BasicToken basicTokenLocalVar{{-index}} = (BasicToken) await BasicTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(basicTokenLocalVar{{-index}}); + + basicTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isBasicBasic}} + {{#isBasicBearer}} + + BearerToken bearerTokenLocalVar{{-index}} = (BearerToken) await BearerTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(bearerTokenLocalVar{{-index}}); + + bearerTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isBasicBearer}} + {{#isOAuth}} + + OAuthToken oauthTokenLocalVar{{-index}} = (OAuthToken) await OauthTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); + + tokenBaseLocalVars.Add(oauthTokenLocalVar{{-index}}); + + oauthTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, "{{keyParamName}}"); + {{/isOAuth}} + {{#isHttpSignature}} + + HttpSignatureToken httpSignatureTokenLocalVar{{-index}} = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellation: cancellationToken).ConfigureAwait(false); - OAuthToken oauthToken = (OAuthToken) await OauthTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + tokenBaseLocalVars.Add(httpSignatureTokenLocalVar{{-index}}); - tokens.Add(oauthToken); + if (httpRequestMessageLocalVar.Content != null) { + string requestBodyLocalVar = await httpRequestMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); - oauthToken.UseInHeader(request, "{{keyParamName}}");{{/isOAuth}}{{#isHttpSignature}} - - HttpSignatureToken signatureToken = (HttpSignatureToken) await HttpSignatureTokenProvider.GetAsync(cancellationToken).ConfigureAwait(false); + httpSignatureTokenLocalVar{{-index}}.UseInHeader(httpRequestMessageLocalVar, requestBodyLocalVar, cancellationToken); + } + {{/isHttpSignature}} + {{/authMethods}} + {{#consumes}} + {{#-first}} + + {{=<% %>=}} + string[] contentTypes = new string[] {<%/-first%> + <%={{ }}=%> + "{{{mediaType}}}"{{^-last}},{{/-last}}{{#-last}} + }; + {{/-last}} + {{/consumes}} + {{#consumes}} + {{#-first}} + + string{{nrt?}} contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); + + if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) + httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + + {{/-first}} + {{/consumes}} + {{#produces}} + {{#-first}} + + {{=<% %>=}} + string[] acceptLocalVars = new string[] {<%/-first%> + <%={{ }}=%> + "{{{mediaType}}}"{{^-last}},{{/-last}}{{#-last}} + }; + {{/-last}} + {{/produces}} + {{#produces}} + {{#-first}} + + string{{nrt?}} acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + {{/-first}} + {{/produces}} + {{#net60OrLater}} + + httpRequestMessageLocalVar.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}; + {{/net60OrLater}} + {{^net60OrLater}} + httpRequestMessageLocalVar.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}"); + {{/net60OrLater}} + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); - tokens.Add(signatureToken); + ILogger<{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{operationId}}ApiResponse>(); - string requestBody = await request.Content{{nrt!}}.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); + {{operationId}}ApiResponse apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{path}}", requestedAtLocalVar, _jsonSerializerOptions); - signatureToken.UseInHeader(request, requestBody, cancellationToken);{{/isHttpSignature}}{{/authMethods}}{{#consumes}}{{#-first}} + After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); - string[] contentTypes = new string[] { - {{/-first}}"{{{mediaType}}}"{{^-last}}, - {{/-last}}{{#-last}} - };{{/-last}}{{/consumes}}{{#consumes}}{{#-first}} + Events.ExecuteOn{{operationId}}(apiResponseLocalVar); - string{{nrt?}} contentType = ClientUtils.SelectHeaderContentType(contentTypes); + {{#authMethods}} + {{#-first}} + if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429) + foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars) + tokenBaseLocalVar.BeginRateLimit(); - if (contentType != null) - request.Content.Headers.Add("ContentType", contentType);{{/-first}}{{/consumes}}{{#produces}}{{#-first}} + {{/-first}} + {{/authMethods}} + {{#net80OrLater}} + {{#responses}} + {{#vendorExtensions.x-set-cookie}} + if (httpResponseMessageLocalVar.StatusCode == (HttpStatusCode) {{code}} && httpResponseMessageLocalVar.Headers.TryGetValues("Set-Cookie", out var cookieHeadersLocalVar)) + { + foreach(string cookieHeader in cookieHeadersLocalVar) + { + IList setCookieHeaderValuesLocalVar = Microsoft.Net.Http.Headers.SetCookieHeaderValue.ParseList(cookieHeadersLocalVar.ToArray()); - string[] accepts = new string[] { {{/-first}}{{/produces}} - {{#produces}}"{{{mediaType}}}"{{^-last}}, - {{/-last}}{{/produces}}{{#produces}}{{#-last}} - };{{/-last}}{{/produces}}{{#produces}}{{#-first}} + foreach(Microsoft.Net.Http.Headers.SetCookieHeaderValue setCookieHeaderValueLocalVar in setCookieHeaderValuesLocalVar) + { + Cookie cookieLocalVar = new Cookie(setCookieHeaderValueLocalVar.Name.ToString(), setCookieHeaderValueLocalVar.Value.ToString()) + { + HttpOnly = setCookieHeaderValueLocalVar.HttpOnly + }; - string{{nrt?}} accept = ClientUtils.SelectHeaderAccept(accepts); + if (setCookieHeaderValueLocalVar.Expires.HasValue) + cookieLocalVar.Expires = setCookieHeaderValueLocalVar.Expires.Value.UtcDateTime; - if (accept != null) - request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept)); - {{/-first}}{{/produces}}{{^netStandard}} - request.Method = HttpMethod.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}};{{/netStandard}}{{#netStandard}} - request.Method = new HttpMethod("{{#lambda.uppercase}}{{httpMethod}}{{/lambda.uppercase}}");{{/netStandard}}{{! early standard versions do not have HttpMethod.Patch }} + if (setCookieHeaderValueLocalVar.Path.HasValue) + cookieLocalVar.Path = setCookieHeaderValueLocalVar.Path.Value; - using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false)) - { - DateTime requestedAt = DateTime.UtcNow; + if (setCookieHeaderValueLocalVar.Domain.HasValue) + cookieLocalVar.Domain = setCookieHeaderValueLocalVar.Domain.Value; - string responseContent = await responseMessage.Content.ReadAsStringAsync({{^netStandard}}{{^netcoreapp3.1}}cancellationToken.GetValueOrDefault(){{/netcoreapp3.1}}{{/netStandard}}).ConfigureAwait(false); - - if (ApiResponded != null) - { - try - { - ApiResponded.Invoke(this, new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "{{path}}")); - } - catch(Exception e) - { - Logger.LogError(e, "An error occured while invoking ApiResponded."); + CookieContainer.Value.Add(new Uri($"{uriBuilderLocalVar.Scheme}://{uriBuilderLocalVar.Host}"), cookieLocalVar); + } } } - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}> apiResponse = new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}}>(responseMessage, responseContent); - - if (apiResponse.IsSuccessStatusCode) - apiResponse.Content = JsonSerializer.Deserialize<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}>(apiResponse.RawContent, _jsonSerializerOptions);{{#authMethods}} - else if (apiResponse.StatusCode == (HttpStatusCode) 429) - foreach(TokenBase token in tokens) - token.BeginRateLimit();{{/authMethods}} - - return apiResponse; + {{/vendorExtensions.x-set-cookie}} + {{/responses}} + {{/net80OrLater}} + return apiResponseLocalVar; } } } catch(Exception e) { - Logger.LogError(e, "An error occured while sending the request to the server."); + OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}e "{{path}}" uriBuilderLocalVar.Path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + Events.ExecuteOnError{{operationId}}(e); throw; } - }{{^-last}} - {{/-last}} + {{/lambda.trimLineBreaks}} + } + {{#responses}} + {{#-first}} + + /// + /// The + /// + {{>visibility}} partial class {{operationId}}ApiResponse : {{packageName}}.{{clientPackage}}.ApiResponse, {{interfacePrefix}}{{operationId}}ApiResponse + { + /// + /// The logger + /// + public ILogger<{{operationId}}ApiResponse> Logger { get; } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public {{operationId}}ApiResponse(ILogger<{{operationId}}ApiResponse> logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); + {{#responses}} + + {{#vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is the default response type + /// + /// + public bool Is{{vendorExtensions.x-http-status}} => {{#vendorExtensions.x-only-default}}true{{/vendorExtensions.x-only-default}}{{^vendorExtensions.x-only-default}}{{#lambda.joinConditions}}{{#responses}}{{^vendorExtensions.x-http-status-is-default}}!Is{{vendorExtensions.x-http-status}} {{/vendorExtensions.x-http-status-is-default}}{{/responses}}{{/lambda.joinConditions}}{{/vendorExtensions.x-only-default}}; + {{/vendorExtensions.x-http-status-is-default}} + {{^vendorExtensions.x-http-status-is-default}} + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + {{#vendorExtensions.x-http-status-range}} + public bool Is{{vendorExtensions.x-http-status}} + { + get + { + int statusCode = (int)StatusCode; + return {{vendorExtensions.x-http-status-range}}00 >= statusCode && {{vendorExtensions.x-http-status-range}}99 <= statusCode; + } + } + {{/vendorExtensions.x-http-status-range}} + {{^vendorExtensions.x-http-status-range}} + public bool Is{{vendorExtensions.x-http-status}} => {{code}} == (int)StatusCode; + {{/vendorExtensions.x-http-status-range}} + {{/vendorExtensions.x-http-status-is-default}} + {{#dataType}} + + /// + /// Deserializes the response if the response is {{code}} {{vendorExtensions.x-http-status}} + /// + /// + public {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{vendorExtensions.x-http-status}}() + { + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>AsModel}} + {{/lambda.indent4}} + {{/lambda.trimTrailingWithNewLine}} + } + + /// + /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} and the deserialized response is not null + /// + /// + /// + public bool Try{{vendorExtensions.x-http-status}}({{#net60OrLater}}[NotNullWhen(true)]{{/net60OrLater}}out {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result) + { + result = null; + + try + { + result = {{vendorExtensions.x-http-status}}(); + } catch (Exception e) + { + OnDeserializationErrorDefaultImplementation(e, (HttpStatusCode){{#vendorExtensions.x-http-status-range}}{{.}}{{/vendorExtensions.x-http-status-range}}{{^vendorExtensions.x-http-status-range}}{{code}}{{/vendorExtensions.x-http-status-range}}); + } + + return result != null; + } + {{/dataType}} + {{#-last}} + + private void OnDeserializationErrorDefaultImplementation(Exception exception, HttpStatusCode httpStatusCode) + { + bool suppressDefaultLog = false; + OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>OnDeserializationError}} + {{/lambda.indent4}} + {{/lambda.trimTrailingWithNewLine}} + } + + partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode); + {{/-last}} + {{/responses}} + } + {{/-first}} + {{/responses}} {{/operation}} } {{/operations}} } +{{/lambda.trimLineBreaks}} diff --git a/templates/libraries/generichost/api_test.mustache b/templates/libraries/generichost/api_test.mustache index b64731f..02ce221 100644 --- a/templates/libraries/generichost/api_test.mustache +++ b/templates/libraries/generichost/api_test.mustache @@ -8,10 +8,10 @@ using {{packageName}}.{{apiPackage}};{{#hasImport}} using {{packageName}}.{{modelPackage}};{{/hasImport}} -{{{testInstructions}}} +{{>testInstructions}} -namespace {{packageName}}.Test.Api +namespace {{packageName}}.Test.{{apiPackage}} { /// /// Class for testing {{classname}} @@ -24,7 +24,6 @@ namespace {{packageName}}.Test.Api { _instance = _host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); } - {{#operations}} {{#operation}} @@ -35,10 +34,16 @@ namespace {{packageName}}.Test.Api public async Task {{operationId}}AsyncTest() { {{#allParams}} - {{{dataType}}} {{paramName}} = default; + {{^required}}Client.Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} = default{{nrt!}}; {{/allParams}} - {{#returnType}}var response = {{/returnType}}await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - Assert.IsType<{{{.}}}>(response);{{/returnType}} + {{#returnType}} + var response = await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + var model = response.{{#lambda.first}}{{#responses}}{{vendorExtensions.x-http-status}} {{/responses}}{{/lambda.first}}(); + Assert.IsType<{{{.}}}>(model); + {{/returnType}} + {{^returnType}} + await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/returnType}} } {{/operation}} {{/operations}} diff --git a/templates/libraries/generichost/git_push.ps1.mustache b/templates/libraries/generichost/git_push.ps1.mustache index 0f4084e..f263c2b 100644 --- a/templates/libraries/generichost/git_push.ps1.mustache +++ b/templates/libraries/generichost/git_push.ps1.mustache @@ -49,7 +49,7 @@ Set-StrictMode -Version 3.0 if ($Help){ Write-Output " This script will initialize a git repository, then add and commit all files. - The local repository will then be pushed to your prefered git provider. + The local repository will then be pushed to your preferred git provider. If the remote repository does not exist yet and you are using GitHub, the repository will be created for you provided you have the GitHub CLI installed. diff --git a/templates/libraries/generichost/model.mustache b/templates/libraries/generichost/model.mustache index d6e643a..f993157 100644 --- a/templates/libraries/generichost/model.mustache +++ b/templates/libraries/generichost/model.mustache @@ -10,7 +10,9 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.IO; +{{^useGenericHost}} using System.Runtime.Serialization; +{{/useGenericHost}} using System.Text; using System.Text.RegularExpressions; using System.Text.Json; @@ -21,29 +23,28 @@ using System.ComponentModel.DataAnnotations; {{#useCompareNetObjects}} using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; {{/useCompareNetObjects}} +{{#useGenericHost}} +{{#useSourceGeneration}} +using System.Text.Json.Serialization.Metadata; +{{/useSourceGeneration}} +using {{packageName}}.{{clientPackage}}; +{{/useGenericHost}} {{#models}} +{{#lambda.trimTrailingWithNewLine}} {{#model}} namespace {{packageName}}.{{modelPackage}} { -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}} +{{#isEnum}} +{{>modelEnum}} +{{/isEnum}} +{{^isEnum}} +{{>modelGeneric}} -{{#allOf}} -{{#-first}} -{{>JsonConverter}} -{{/-first}} -{{/allOf}} -{{#anyOf}} -{{#-first}} -{{>JsonConverter}} -{{/-first}} -{{/anyOf}} -{{#oneOf}} -{{#-first}} {{>JsonConverter}} -{{/-first}} -{{/oneOf}} {{/isEnum}} +{{>SourceGenerationContext}} {{/model}} +{{/lambda.trimTrailingWithNewLine}} {{/models}} } diff --git a/templates/libraries/generichost/modelGeneric.mustache b/templates/libraries/generichost/modelGeneric.mustache index 1f18f91..6bf210b 100644 --- a/templates/libraries/generichost/modelGeneric.mustache +++ b/templates/libraries/generichost/modelGeneric.mustache @@ -1,96 +1,83 @@ /// /// {{description}}{{^description}}{{classname}}{{/description}} /// - {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}{{^parentModel}}, IValidatableObject{{/parentModel}}{{/validatable}} + {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}}{{#readOnlyVars}}{{#-first}} : .{{/-first}}{{/readOnlyVars}}{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{>ImplementsIEquatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} { {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} /// /// Initializes a new instance of the class. /// - /// - {{#composedSchemas.allOf}} - {{^isInherited}} - /// - {{/isInherited}} - {{/composedSchemas.allOf}} + /// {{#composedSchemas.anyOf}} - /// + /// {{/composedSchemas.anyOf}} {{#allVars}} - /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{^isDiscriminator}} + /// {{description}}{{^description}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{/isDiscriminator}} {{/allVars}} - public {{classname}}({{#lambda.joinWithComma}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{#model.composedSchemas.allOf}}{{^isInherited}}{{{dataType}}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/isInherited}}{{/model.composedSchemas.allOf}}{{#model.composedSchemas.anyOf}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/model.composedSchemas.anyOf}}{{#model.allVars}}{{^compulsory}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/compulsory}}{{#compulsory}}{{{datatypeWithEnum}}}{{/compulsory}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#defaultValue}} = {{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}{{^compulsory}} = default{{/compulsory}}{{/defaultValue}} {{/model.allVars}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{#parentModel.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/isInherited}}{{/parentModel.composedSchemas.allOf}}{{#parentModel.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{parent}}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.anyOf}}{{#allVars}}{{#isInherited}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} {{/isInherited}}{{/allVars}}{{/lambda.joinWithComma}}){{/parent}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{{dataType}}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{#model.composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{baseType}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{parent}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}.{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { - {{#allVars}} - {{^isInherited}} - {{#required}} - {{^isNullable}} - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) - throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null."); - - {{/isNullable}} - {{/required}} - {{/isInherited}} - {{/allVars}} - {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}; - {{#composedSchemas.allOf}} - {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}; - {{/composedSchemas.allOf}} {{#composedSchemas.anyOf}} - {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}; + {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/composedSchemas.anyOf}} + {{name}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{#allVars}} + {{^isDiscriminator}} {{^isInherited}} - {{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/isInherited}} + {{#isInherited}} + {{#isNew}} + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/isNew}} + {{/isInherited}} + {{/isDiscriminator}} {{/allVars}} + OnCreated(); } + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} {{^composedSchemas.oneOf}} /// /// Initializes a new instance of the class. /// - {{#composedSchemas.allOf}} - {{^isInherited}} - /// - {{/isInherited}} - {{/composedSchemas.allOf}} {{#composedSchemas.anyOf}} - /// + /// {{/composedSchemas.anyOf}} {{#allVars}} - /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{^isDiscriminator}} + /// {{description}}{{^description}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} + {{/isDiscriminator}} {{/allVars}} - public {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.allOf}}{{^isInherited}}{{{dataType}}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/isInherited}}{{/composedSchemas.allOf}}{{#composedSchemas.anyOf}}{{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}} {{/composedSchemas.anyOf}}{{#allVars}}{{^compulsory}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/compulsory}}{{#compulsory}}{{{datatypeWithEnum}}}{{/compulsory}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#defaultValue}} = {{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}{{^compulsory}} = default{{/compulsory}}{{/defaultValue}} {{/allVars}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{#parentModel.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{parent}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/isInherited}}{{/parentModel.composedSchemas.allOf}}{{#parentModel.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{parent}}}{{/lambda.camelcase_param}}.{{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.anyOf}}{{#allVars}}{{#isInherited}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} {{/isInherited}}{{/allVars}}{{/lambda.joinWithComma}}){{/parent}} + {{^composedSchemas.anyOf}} + [JsonConstructor] + {{/composedSchemas.anyOf}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{baseType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { - {{#allVars}} - {{^isInherited}} - {{#required}} - {{^isNullable}} - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) - throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null."); - - {{/isNullable}} - {{/required}} - {{/isInherited}} - {{/allVars}} - {{#composedSchemas.allOf}} - {{^isInherited}} - {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}; - {{/isInherited}} - {{/composedSchemas.allOf}} {{#composedSchemas.anyOf}} - {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} = {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}; + {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/composedSchemas.anyOf}} {{#allVars}} + {{^isDiscriminator}} {{^isInherited}} - {{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/isInherited}} + {{#isInherited}} + {{#isNew}} + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{/isNew}} {{/isInherited}} + {{/isDiscriminator}} {{/allVars}} + OnCreated(); } {{/composedSchemas.oneOf}} + partial void OnCreated(); + {{#vars}} {{#items.isEnum}} {{#items}} @@ -104,71 +91,144 @@ {{>modelInnerEnum}} {{/complexType}} {{/isEnum}} + {{^isDiscriminator}} {{#isEnum}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} /// /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}} {{/description}} + {{#example}} + /// {{.}} + {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{#isNullable}}{{#required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}}{{^isNullable}}{{#required}}{{{datatypeWithEnum}}}{{/required}}{{/isNullable}}{{#isNullable}}{{^required}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/required}}{{/isNullable}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + public {{#isNew}}new {{/isNew}}{{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} {{/isEnum}} + {{/isDiscriminator}} {{/vars}} {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} /// - /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} {{#deprecated}} [Obsolete] {{/deprecated}} - public {{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option; } {{^isReadOnly}}set { this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.anyOf}} {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} /// - /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} {{#deprecated}} [Obsolete] {{/deprecated}} - public {{{dataType}}}{{#isNullable}}{{nrt?}}{{/isNullable}} {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + public {{{dataType}}}{{>NullConditionalProperty}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}} { get; {{^isReadOnly}}set; {{/isReadOnly}}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} - {{#composedSchemas.allOf}} - {{^isInherited}} + {{#allVars}} + {{#isDiscriminator}} + {{^model.composedSchemas.anyOf}} + {{^model.composedSchemas.oneOf}} /// - /// {{description}}{{^description}}Gets or Sets {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}}{{/description}} + /// The discriminator + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public {{#isNew}}new {{/isNew}}{{datatypeWithEnum}} {{name}} { get; } = {{^isNew}}"{{classname}}"{{/isNew}}{{#isNew}}{{^isEnum}}"{{classname}}"{{/isEnum}}{{#isEnum}}({{datatypeWithEnum}})Enum.Parse(typeof({{datatypeWithEnum}}), "{{classname}}"){{/isEnum}}{{/isNew}}; + + {{/model.composedSchemas.oneOf}} + {{/model.composedSchemas.anyOf}} + {{/isDiscriminator}} + {{^isDiscriminator}} + {{^isEnum}} + {{#isInherited}} + {{#isNew}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public new Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} + /// + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} + [JsonPropertyName("{{baseName}}")] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{{dataType}}} {{#lambda.titlecase}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.titlecase}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + public new {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + {{/isNew}} {{/isInherited}} - {{/composedSchemas.allOf}} - {{#allVars}} {{^isInherited}} - {{^isEnum}} + {{^required}} + /// + /// Used to track the state of {{{name}}} + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + + {{/required}} /// /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} [JsonPropertyName("{{baseName}}")] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{^compulsory}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/compulsory}}{{#compulsory}}{{{datatypeWithEnum}}}{{/compulsory}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} - {{/isEnum}} {{/isInherited}} + {{/isEnum}} + {{/isDiscriminator}} {{/allVars}} {{#isAdditionalPropertiesTrue}} {{^parentModel}} @@ -176,7 +236,7 @@ /// Gets or Sets additional properties /// [JsonExtensionData] - public Dictionary AdditionalProperties { get; set; } = new Dictionary(); + public Dictionary AdditionalProperties { get; } = new Dictionary(); {{/parentModel}} {{/isAdditionalPropertiesTrue}} @@ -189,10 +249,12 @@ StringBuilder sb = new StringBuilder(); sb.Append("class {{classname}} {\n"); {{#parent}} - sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" ").Append(base.ToString()?.Replace("\n", "\n ")).Append("\n"); {{/parent}} {{#vars}} + {{^isDiscriminator}} sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); + {{/isDiscriminator}} {{/vars}} {{#isAdditionalPropertiesTrue}} {{^parentModel}} @@ -202,6 +264,9 @@ sb.Append("}\n"); return sb.ToString(); } + {{#equatable}} + {{#readOnlyVars}} + {{#-first}} /// /// Returns true if objects are equal @@ -230,29 +295,28 @@ {{/useCompareNetObjects}} {{^useCompareNetObjects}} if (input == null) - { return false; - } - return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{^isContainer}} + + return {{#parent}}base.Equals(input) && {{/parent}}{{#readOnlyVars}}{{^isInherited}}{{^isContainer}} ( - this.{{name}} == input.{{name}} || + {{name}} == input.{{name}} || {{^vendorExtensions.x-is-value-type}} - (this.{{name}} != null && - this.{{name}}.Equals(input.{{name}})) + ({{name}} != null && + {{name}}.Equals(input.{{name}})) {{/vendorExtensions.x-is-value-type}} {{#vendorExtensions.x-is-value-type}} - this.{{name}}.Equals(input.{{name}}) + {{name}}.Equals(input.{{name}}) {{/vendorExtensions.x-is-value-type}} ){{^-last}} && {{/-last}}{{/isContainer}}{{#isContainer}} ( - this.{{name}} == input.{{name}} || - {{^vendorExtensions.x-is-value-type}}this.{{name}} != null && + {{name}} == input.{{name}} || + {{^vendorExtensions.x-is-value-type}}{{name}} != null && input.{{name}} != null && - {{/vendorExtensions.x-is-value-type}}this.{{name}}.SequenceEqual(input.{{name}}) - ){{^-last}} && {{/-last}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} + {{/vendorExtensions.x-is-value-type}}{{name}}.SequenceEqual(input.{{name}}) + ){{^-last}} && {{/-last}}{{/isContainer}}{{/isInherited}}{{/readOnlyVars}}{{^readOnlyVars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/readOnlyVars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}} {{#isAdditionalPropertiesTrue}} {{^parentModel}} - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); + && (AdditionalProperties.Count == input.AdditionalProperties.Count && !AdditionalProperties.Except(input.AdditionalProperties).Any()); {{/parentModel}} {{/isAdditionalPropertiesTrue}} {{/useCompareNetObjects}} @@ -272,31 +336,41 @@ {{^parent}} int hashCode = 41; {{/parent}} - {{#vars}} - {{^vendorExtensions.x-is-value-type}} - if (this.{{name}} != null) - { - hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); - } - {{/vendorExtensions.x-is-value-type}} - {{#vendorExtensions.x-is-value-type}} - hashCode = (hashCode * 59) + this.{{name}}.GetHashCode(); - {{/vendorExtensions.x-is-value-type}} - {{/vars}} + {{#readOnlyVars}} + {{#required}} + {{^isNullable}} + hashCode = (hashCode * 59) + {{name}}.GetHashCode(); + {{/isNullable}} + {{/required}} + {{/readOnlyVars}} + {{#readOnlyVars}} + {{#lambda.copy}} + + if ({{name}} != null) + hashCode = (hashCode * 59) + {{name}}.GetHashCode(); + {{/lambda.copy}} + {{#isNullable}} + {{#lambda.pasteOnce}}{{/lambda.pasteOnce}} + {{/isNullable}} + {{^required}} + {{#lambda.pasteOnce}}{{/lambda.pasteOnce}} + {{/required}} + {{/readOnlyVars}} {{#isAdditionalPropertiesTrue}} {{^parentModel}} - if (this.AdditionalProperties != null) - { - hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); - } + hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode(); {{/parentModel}} {{/isAdditionalPropertiesTrue}} + return hashCode; } } - + {{/-first}} + {{/readOnlyVars}} + {{/equatable}} {{#validatable}} {{^parentModel}} + {{>validatable}} {{/parentModel}} {{/validatable}} diff --git a/templates/libraries/generichost/testInstructions.mustache b/templates/libraries/generichost/testInstructions.mustache new file mode 100644 index 0000000..7bf738e --- /dev/null +++ b/templates/libraries/generichost/testInstructions.mustache @@ -0,0 +1,18 @@ +/* ********************************************************************************* +* Follow these manual steps to construct tests. +* This file will not be overwritten. +* ********************************************************************************* +* 1. Navigate to ApiTests.Base.cs and ensure any tokens are being created correctly. +* Take care not to commit credentials to any repository. +* +* 2. Mocking is coordinated by ApiTestsBase#AddApiHttpClients. +* To mock the client, use the generic AddApiHttpClients. +* To mock the server, change the client's BaseAddress. +* +* 3. Locate the test you want below +* - remove the skip property from the Fact attribute +* - set the value of any variables if necessary +* +* 4. Run the tests and ensure they work. +* +*/ \ No newline at end of file diff --git a/templates/libraries/httpclient/ApiClient.mustache b/templates/libraries/httpclient/ApiClient.mustache index 866f036..cefe6be 100644 --- a/templates/libraries/httpclient/ApiClient.mustache +++ b/templates/libraries/httpclient/ApiClient.mustache @@ -79,7 +79,7 @@ namespace {{packageName}}.Client public async Task Deserialize(HttpResponseMessage response) { - var result = (T) await Deserialize(response, typeof(T)); + var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); return result; } @@ -91,30 +91,54 @@ namespace {{packageName}}.Client /// Object representation of the JSON string. internal async Task Deserialize(HttpResponseMessage response, Type type) { - IList headers = response.Headers.Select(x => x.Key + "=" + x.Value).ToList(); + IList headers = new List(); + // process response headers, e.g. Access-Control-Allow-Methods + foreach (var responseHeader in response.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + + // process response content headers, e.g. Content-Type + foreach (var responseHeader in response.Content.Headers) + { + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + } + // RFC 2183 & RFC 2616 + var fileNameRegex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$", RegexOptions.IgnoreCase); if (type == typeof(byte[])) // return byte array { - return await response.Content.ReadAsByteArrayAsync(); + return await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); } else if (type == typeof(FileParameter)) { - return new FileParameter(await response.Content.ReadAsStreamAsync()); + if (headers != null) { + foreach (var header in headers) + { + var match = fileNameRegex.Match(header.ToString()); + if (match.Success) + { + string fileName = ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); + return new FileParameter(fileName, await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); + } + } + } + return new FileParameter(await response.Content.ReadAsStreamAsync().ConfigureAwait(false)); } // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) if (type == typeof(Stream)) { - var bytes = await response.Content.ReadAsByteArrayAsync(); + var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); if (headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) ? Path.GetTempPath() : _configuration.TempFolderPath; - var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); + foreach (var header in headers) { - var match = regex.Match(header.ToString()); + var match = fileNameRegex.Match(header.ToString()); if (match.Success) { string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); @@ -129,18 +153,18 @@ namespace {{packageName}}.Client if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object { - return DateTime.Parse(await response.Content.ReadAsStringAsync(), null, System.Globalization.DateTimeStyles.RoundtripKind); + return DateTime.Parse(await response.Content.ReadAsStringAsync().ConfigureAwait(false), null, System.Globalization.DateTimeStyles.RoundtripKind); } if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type { - return Convert.ChangeType(await response.Content.ReadAsStringAsync(), type); + return Convert.ChangeType(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type); } // at this point, it must be a model (json) try { - return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync(), type, _serializerSettings); + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), type, _serializerSettings); } catch (Exception e) { @@ -401,7 +425,7 @@ namespace {{packageName}}.Client private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) { T result = (T) responseData; - string rawContent = await response.Content.ReadAsStringAsync(); + string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) { @@ -448,7 +472,7 @@ namespace {{packageName}}.Client private async Task> ExecAsync(HttpRequestMessage req, IReadableConfiguration configuration, - System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { CancellationTokenSource timeoutTokenSource = null; CancellationTokenSource finalTokenSource = null; @@ -514,10 +538,10 @@ namespace {{packageName}}.Client if (!response.IsSuccessStatusCode) { - return await ToApiResponse(response, default(T), req.RequestUri); + return await ToApiResponse(response, default(T), req.RequestUri).ConfigureAwait(false); } - object responseData = await deserializer.Deserialize(response); + object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) @@ -526,12 +550,21 @@ namespace {{packageName}}.Client } else if (typeof(T).Name == "Stream") // for binary response { - responseData = (T) (object) await response.Content.ReadAsStreamAsync(); + responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); } InterceptResponse(req, response); - return await ToApiResponse(response, responseData, req.RequestUri); + return await ToApiResponse(response, responseData, req.RequestUri).ConfigureAwait(false); + } + catch (OperationCanceledException original) + { + if (timeoutTokenSource != null && timeoutTokenSource.IsCancellationRequested) + { + throw new TaskCanceledException($"[{req.Method}] {req.RequestUri} was timeout.", + new TimeoutException(original.Message, original)); + } + throw; } finally { @@ -558,7 +591,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); @@ -573,7 +606,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); @@ -588,7 +621,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); @@ -603,7 +636,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); @@ -618,7 +651,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); @@ -633,7 +666,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); @@ -648,7 +681,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); diff --git a/templates/libraries/httpclient/RequestOptions.mustache b/templates/libraries/httpclient/RequestOptions.mustache index 6285964..25e76d0 100644 --- a/templates/libraries/httpclient/RequestOptions.mustache +++ b/templates/libraries/httpclient/RequestOptions.mustache @@ -25,7 +25,7 @@ namespace {{packageName}}.Client public Multimap QueryParameters { get; set; } /// - /// Header parameters to be applied to to the request. + /// Header parameters to be applied to the request. /// Keys may have 1 or more values associated. /// public Multimap HeaderParameters { get; set; } diff --git a/templates/libraries/httpclient/api.mustache b/templates/libraries/httpclient/api.mustache index c0d4957..ebf563b 100644 --- a/templates/libraries/httpclient/api.mustache +++ b/templates/libraries/httpclient/api.mustache @@ -78,7 +78,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); /// /// {{summary}} @@ -95,7 +95,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); {{/operation}} #endregion Asynchronous Operations } @@ -552,7 +552,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} @@ -570,7 +570,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { {{#allParams}} {{#required}} @@ -605,6 +605,12 @@ namespace {{packageName}}.{{apiPackage}} var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + {{#constantParams}} + {{#isPathParam}} + // Set client side default value of Path Param "{{baseName}}". + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant path parameter + {{/isPathParam}} + {{/constantParams}} {{#pathParams}} {{#required}} localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter @@ -616,6 +622,12 @@ namespace {{packageName}}.{{apiPackage}} } {{/required}} {{/pathParams}} + {{#constantParams}} + {{#isQueryParam}} + // Set client side default value of Query Param "{{baseName}}". + localVarRequestOptions.QueryParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant query parameter + {{/isQueryParam}} + {{/constantParams}} {{#queryParams}} {{#required}} localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); @@ -627,6 +639,12 @@ namespace {{packageName}}.{{apiPackage}} } {{/required}} {{/queryParams}} + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + {{/isHeaderParam}} + {{/constantParams}} {{#headerParams}} {{#required}} localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter diff --git a/templates/libraries/unityWebRequest/ApiClient.mustache b/templates/libraries/unityWebRequest/ApiClient.mustache new file mode 100644 index 0000000..df7b9d0 --- /dev/null +++ b/templates/libraries/unityWebRequest/ApiClient.mustache @@ -0,0 +1,639 @@ +{{>partial_header}} + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters; +using System.Text; +using System.Threading; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs; +using System.Net.Http; +using System.Net.Http.Headers; +using UnityEngine.Networking; +using UnityEngine; + +namespace {{packageName}}.Client +{ + /// + /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON. + /// + internal class CustomJsonCodec + { + private readonly IReadableConfiguration _configuration; + private static readonly string _contentType = "application/json"; + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + public CustomJsonCodec(IReadableConfiguration configuration) + { + _configuration = configuration; + } + + public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) + { + _serializerSettings = serializerSettings; + _configuration = configuration; + } + + /// + /// Serialize the object into a JSON string. + /// + /// Object to be serialized. + /// A JSON string. + public string Serialize(object obj) + { + if (obj != null && obj is {{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema) + { + // the object to be serialized is an oneOf/anyOf schema + return (({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema)obj).ToJson(); + } + else + { + return JsonConvert.SerializeObject(obj, _serializerSettings); + } + } + + public T Deserialize(UnityWebRequest request) + { + var result = (T) Deserialize(request, typeof(T)); + return result; + } + + /// + /// Deserialize the JSON string into a proper object. + /// + /// The UnityWebRequest after it has a response. + /// Object type. + /// Object representation of the JSON string. + internal object Deserialize(UnityWebRequest request, Type type) + { + if (type == typeof(byte[])) // return byte array + { + return request.downloadHandler.data; + } + + // TODO: ? if (type.IsAssignableFrom(typeof(Stream))) + if (type == typeof(Stream)) + { + // NOTE: Ignoring Content-Disposition filename support, since not all platforms + // have a location on disk to write arbitrary data (tvOS, consoles). + return new MemoryStream(request.downloadHandler.data); + } + + if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object + { + return DateTime.Parse(request.downloadHandler.text, null, System.Globalization.DateTimeStyles.RoundtripKind); + } + + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type + { + return Convert.ChangeType(request.downloadHandler.text, type); + } + + var contentType = request.GetResponseHeader("Content-Type"); + + if (!string.IsNullOrEmpty(contentType) && contentType.Contains("application/json")) + { + var text = request.downloadHandler?.text; + + // Generated APIs that don't expect a return value provide System.Object as the type + if (type == typeof(global::System.Object) && (string.IsNullOrEmpty(text) || text.Trim() == "null")) + { + return null; + } + + if (request.responseCode >= 200 && request.responseCode < 300) + { + try + { + // Deserialize as a model + return JsonConvert.DeserializeObject(text, type, _serializerSettings); + } + catch (Exception e) + { + throw new UnexpectedResponseException(request, type, e.ToString()); + } + } + else + { + throw new ApiException((int)request.responseCode, request.error, text); + } + } + + if (type != typeof(global::System.Object) && request.responseCode >= 200 && request.responseCode < 300) + { + throw new UnexpectedResponseException(request, type); + } + + return null; + + } + + public string RootElement { get; set; } + public string Namespace { get; set; } + public string DateFormat { get; set; } + + public string ContentType + { + get { return _contentType; } + set { throw new InvalidOperationException("Not allowed to set content type."); } + } + } + /// + /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations), + /// encapsulating general REST accessor use cases. + /// + /// + /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor. + /// + {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} + { + private readonly string _baseUrl; + + /// + /// Specifies the settings on a object. + /// These settings can be adjusted to accommodate custom serialization rules. + /// + public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings + { + // OpenAPI generated types generally hide default constructors. + ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy + { + OverrideSpecifiedNames = false + } + } + }; + + /// + /// Initializes a new instance of the , defaulting to the global configurations' base url. + /// + public ApiClient() : + this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) + { + } + + /// + /// Initializes a new instance of the . + /// + /// The target service's base path in URL format. + /// + public ApiClient(string basePath) + { + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); + + _baseUrl = basePath; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + } + + /// + /// Provides all logic for constructing a new UnityWebRequest. + /// At this point, all information for querying the service is known. Here, it is simply + /// mapped into the UnityWebRequest. + /// + /// The http verb. + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// [private] A new UnityWebRequest instance. + /// + private UnityWebRequest NewRequest( + string method, + string path, + RequestOptions options, + IReadableConfiguration configuration) + { + if (path == null) throw new ArgumentNullException("path"); + if (options == null) throw new ArgumentNullException("options"); + if (configuration == null) throw new ArgumentNullException("configuration"); + + WebRequestPathBuilder builder = new WebRequestPathBuilder(_baseUrl, path); + + builder.AddPathParameters(options.PathParameters); + + builder.AddQueryParameters(options.QueryParameters); + + string contentType = null; + if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type")) + { + var contentTypes = options.HeaderParameters["Content-Type"]; + contentType = contentTypes.FirstOrDefault(); + } + + var uri = builder.GetFullUri(); + UnityWebRequest request = null; + + if (contentType == "multipart/form-data") + { + var formData = new List(); + foreach (var formParameter in options.FormParameters) + { + formData.Add(new MultipartFormDataSection(formParameter.Key, formParameter.Value)); + } + + request = UnityWebRequest.Post(uri, formData); + request.method = method; + } + else if (contentType == "application/x-www-form-urlencoded") + { + var form = new WWWForm(); + foreach (var kvp in options.FormParameters) + { + form.AddField(kvp.Key, kvp.Value); + } + + request = UnityWebRequest.Post(uri, form); + request.method = method; + } + else if (options.Data != null) + { + var serializer = new CustomJsonCodec(SerializerSettings, configuration); + var jsonData = serializer.Serialize(options.Data); + + // Making a post body application/json encoded is whack with UnityWebRequest. + // See: https://stackoverflow.com/questions/68156230/unitywebrequest-post-not-sending-body + request = UnityWebRequest.Put(uri, jsonData); + request.method = method; + request.SetRequestHeader("Content-Type", "application/json"); + } + else + { + request = new UnityWebRequest(builder.GetFullUri(), method); + } + + if (request.downloadHandler == null && typeof(T) != typeof(global::System.Object)) + { + request.downloadHandler = new DownloadHandlerBuffer(); + } + +#if UNITY_EDITOR || !UNITY_WEBGL + if (configuration.UserAgent != null) + { + request.SetRequestHeader("User-Agent", configuration.UserAgent); + } +#endif + + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.SetRequestHeader(headerParam.Key, headerParam.Value); + } + } + + if (options.HeaderParameters != null) + { + foreach (var headerParam in options.HeaderParameters) + { + foreach (var value in headerParam.Value) + { + // Todo make content headers actually content headers + request.SetRequestHeader(headerParam.Key, value); + } + } + } + + if (options.Cookies != null && options.Cookies.Count > 0) + { + #if UNITY_WEBGL + throw new System.InvalidOperationException("UnityWebRequest does not support setting cookies in WebGL"); + #else + if (options.Cookies.Count != 1) + { + UnityEngine.Debug.LogError("Only one cookie supported, ignoring others"); + } + + request.SetRequestHeader("Cookie", options.Cookies[0].ToString()); + #endif + } + + return request; + + } + + partial void InterceptRequest(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration); + partial void InterceptResponse(UnityWebRequest req, string path, RequestOptions options, IReadableConfiguration configuration, ref object responseData); + + private ApiResponse ToApiResponse(UnityWebRequest request, object responseData) + { + T result = (T) responseData; + + var transformed = new ApiResponse((HttpStatusCode)request.responseCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, request.downloadHandler?.text ?? "") + { + ErrorText = request.error, + Cookies = new List() + }; + + // process response headers, e.g. Access-Control-Allow-Methods + var responseHeaders = request.GetResponseHeaders(); + if (responseHeaders != null) + { + foreach (var responseHeader in request.GetResponseHeaders()) + { + transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value)); + } + } + + return transformed; + } + + private async Task> ExecAsync( + UnityWebRequest request, + string path, + RequestOptions options, + IReadableConfiguration configuration, + System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var deserializer = new CustomJsonCodec(SerializerSettings, configuration); + + using (request) + { + if (configuration.Timeout > 0) + { + request.timeout = (int)Math.Ceiling(configuration.Timeout / 1000.0f); + } + + if (configuration.Proxy != null) + { + throw new InvalidOperationException("Configuration `Proxy` not supported by UnityWebRequest"); + } + + if (configuration.ClientCertificates != null) + { + // Only Android/iOS/tvOS/Standalone players can support certificates, and this + // implementation is intended to work on all platforms. + // + // TODO: Could optionally allow support for this on these platforms. + // + // See: https://docs.unity3d.com/ScriptReference/Networking.CertificateHandler.html + throw new InvalidOperationException("Configuration `ClientCertificates` not supported by UnityWebRequest on all platforms"); + } + + InterceptRequest(request, path, options, configuration); + + var asyncOp = request.SendWebRequest(); + + TaskCompletionSource tsc = new TaskCompletionSource(); + asyncOp.completed += (_) => tsc.TrySetResult(request.result); + + using (var tokenRegistration = cancellationToken.Register(request.Abort, true)) + { + await tsc.Task; + } + + if (request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.DataProcessingError) + { + throw new ConnectionException(request); + } + + object responseData = deserializer.Deserialize(request); + + // if the response type is oneOf/anyOf, call FromJSON to deserialize the data + if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) + { + responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { new ByteArrayContent(request.downloadHandler.data) }); + } + else if (typeof(T).Name == "Stream") // for binary response + { + responseData = (T) (object) new MemoryStream(request.downloadHandler.data); + } + + InterceptResponse(request, path, options, configuration, ref responseData); + + return ToApiResponse(request, responseData); + } + } + + {{#supportsAsync}} + #region IAsynchronousClient + /// + /// Make a HTTP GET request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("GET", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP POST request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("POST", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP PUT request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("PUT", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP DELETE request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("DELETE", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP HEAD request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("HEAD", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP OPTION request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("OPTIONS", path, options, config), path, options, config, cancellationToken); + } + + /// + /// Make a HTTP PATCH request (async). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// Token that enables callers to cancel the request. + /// A Task containing ApiResponse + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var config = configuration ?? GlobalConfiguration.Instance; + return ExecAsync(NewRequest("PATCH", path, options, config), path, options, config, cancellationToken); + } + #endregion IAsynchronousClient + {{/supportsAsync}} + + #region ISynchronousClient + /// + /// Make a HTTP GET request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP POST request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP PUT request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP DELETE request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP HEAD request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP OPTION request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + + /// + /// Make a HTTP PATCH request (synchronous). + /// + /// The target path (or resource). + /// The additional request options. + /// A per-request configuration object. It is assumed that any merge with + /// GlobalConfiguration has been done before calling this method. + /// A Task containing ApiResponse + public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) + { + throw new System.NotImplementedException("UnityWebRequest does not support synchronous operation"); + } + #endregion ISynchronousClient + } +} \ No newline at end of file diff --git a/templates/libraries/unityWebRequest/ConnectionException.mustache b/templates/libraries/unityWebRequest/ConnectionException.mustache new file mode 100644 index 0000000..108ea3b --- /dev/null +++ b/templates/libraries/unityWebRequest/ConnectionException.mustache @@ -0,0 +1,21 @@ +{{>partial_header}} + +using System; +using UnityEngine.Networking; + +namespace {{packageName}}.Client +{ + public class ConnectionException : Exception + { + public UnityWebRequest.Result Result { get; private set; } + public string Error { get; private set; } + + // NOTE: Cannot keep reference to the request since it will be disposed. + public ConnectionException(UnityWebRequest request) + : base($"result={request.result} error={request.error}") + { + Result = request.result; + Error = request.error ?? ""; + } + } +} diff --git a/templates/libraries/unityWebRequest/README.mustache b/templates/libraries/unityWebRequest/README.mustache new file mode 100644 index 0000000..b0a140d --- /dev/null +++ b/templates/libraries/unityWebRequest/README.mustache @@ -0,0 +1,175 @@ +# {{packageName}} - the C# library for the {{appName}} + +{{#appDescriptionWithNewLines}} +{{{.}}} +{{/appDescriptionWithNewLines}} + +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- SDK version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} +- Build package: {{generatorClass}} +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + + +## Version support +This generator should support all current LTS versions of Unity +- Unity 2020.3 (LTS) and up +- .NET Standard 2.1 / .NET Framework + + +## Dependencies + +- [Newtonsoft.Json](https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.0/manual/index.html) - 3.0.2 or later +- [Unity Test Framework](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/index.html) - 1.1.33 or later + + +## Installation +Add the dependencies to `Packages/manifest.json` +``` +{ + "dependencies": { + ... + "com.unity.nuget.newtonsoft-json": "3.0.2", + "com.unity.test-framework": "1.1.33", + } +} +``` + +Then use the namespaces: +```csharp +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; +``` + + +## Getting Started + +```csharp +using System; +using System.Collections.Generic; +using UnityEngine; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.Client; +using {{packageName}}.{{modelPackage}}; + +namespace {{packageName}}Example +{ +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} + public class {{operationId}}Example : MonoBehaviour + { + async void Start() + { + Configuration config = new Configuration(); + config.BasePath = "{{{basePath}}}"; + {{#hasAuthMethods}} + {{#authMethods}} + {{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + config.Username = "YOUR_USERNAME"; + config.Password = "YOUR_PASSWORD"; + {{/isBasicBasic}} + {{#isBasicBearer}} + // Configure Bearer token for authorization: {{{name}}} + config.AccessToken = "YOUR_BEARER_TOKEN"; + {{/isBasicBearer}} + {{#isApiKey}} + // Configure API key authorization: {{{name}}} + config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY"); + // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + // config.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer"); + {{/isApiKey}} + {{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + config.AccessToken = "YOUR_ACCESS_TOKEN"; + {{/isOAuth}} + {{/authMethods}} + + {{/hasAuthMethods}} + var apiInstance = new {{classname}}(config); + {{#allParams}} + {{#isPrimitiveType}} + var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + var {{paramName}} = new {{{dataType}}}(); // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/isPrimitiveType}} + {{/allParams}} + + try + { + {{#summary}} + // {{{.}}} + {{/summary}} + {{#returnType}}{{{.}}} result = {{/returnType}}await apiInstance.{{{operationId}}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + Debug.Log(result);{{/returnType}} + Debug.Log("Done!"); + } + catch (ApiException e) + { + Debug.LogError("Exception when calling {{classname}}.{{operationId}}: " + e.Message ); + Debug.LogError("Status Code: "+ e.ErrorCode); + Debug.LogError(e.StackTrace); + } +{{/-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 + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} + + +## 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}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: Bearer Authentication +{{/isBasicBearer}} +{{#isHttpSignature}}- **Type**: HTTP signature authentication +{{/isHttpSignature}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} diff --git a/templates/libraries/unityWebRequest/RequestOptions.mustache b/templates/libraries/unityWebRequest/RequestOptions.mustache new file mode 100644 index 0000000..0dd18c4 --- /dev/null +++ b/templates/libraries/unityWebRequest/RequestOptions.mustache @@ -0,0 +1,60 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; + +namespace {{packageName}}.Client +{ + /// + /// A container for generalized request inputs. This type allows consumers to extend the request functionality + /// by abstracting away from the default (built-in) request framework (e.g. RestSharp). + /// + public class RequestOptions + { + /// + /// Parameters to be bound to path parts of the Request's URL + /// + public Dictionary PathParameters { get; set; } + + /// + /// Query parameters to be applied to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap QueryParameters { get; set; } + + /// + /// Header parameters to be applied to to the request. + /// Keys may have 1 or more values associated. + /// + public Multimap HeaderParameters { get; set; } + + /// + /// Form parameters to be sent along with the request. + /// + public Dictionary FormParameters { get; set; } + + /// + /// Cookies to be sent along with the request. + /// + public List Cookies { get; set; } + + /// + /// Any data associated with a request body. + /// + public Object Data { get; set; } + + /// + /// Constructs a new instance of + /// + public RequestOptions() + { + PathParameters = new Dictionary(); + QueryParameters = new Multimap(); + HeaderParameters = new Multimap(); + FormParameters = new Dictionary(); + Cookies = new List(); + } + } +} diff --git a/templates/libraries/unityWebRequest/UnexpectedResponseException.mustache b/templates/libraries/unityWebRequest/UnexpectedResponseException.mustache new file mode 100644 index 0000000..a976b2a --- /dev/null +++ b/templates/libraries/unityWebRequest/UnexpectedResponseException.mustache @@ -0,0 +1,26 @@ +{{>partial_header}} + +using System; +using UnityEngine.Networking; + +namespace {{packageName}}.Client +{ + // Thrown when a backend doesn't return an expected response based on the expected type + // of the response data. + public class UnexpectedResponseException : Exception + { + public int ErrorCode { get; private set; } + + // NOTE: Cannot keep reference to the request since it will be disposed. + public UnexpectedResponseException(UnityWebRequest request, System.Type type, string extra = "") + : base(CreateMessage(request, type, extra)) + { + ErrorCode = (int)request.responseCode; + } + + private static string CreateMessage(UnityWebRequest request, System.Type type, string extra) + { + return $"httpcode={request.responseCode}, expected {type.Name} but got data: {extra}"; + } + } +} diff --git a/templates/libraries/unityWebRequest/api.mustache b/templates/libraries/unityWebRequest/api.mustache new file mode 100644 index 0000000..189ebfe --- /dev/null +++ b/templates/libraries/unityWebRequest/api.mustache @@ -0,0 +1,690 @@ +{{>partial_header}} + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Net; +using System.Net.Mime; +using {{packageName}}.Client; +{{#hasImport}}using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.{{apiPackage}} +{ + {{#operations}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Sync : IApiAccessor + { + #region Synchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + {{#notes}} + /// + /// {{.}} + /// + {{/notes}} + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/operation}} + #endregion Synchronous Operations + } + + {{#supportsAsync}} + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}}Async : IApiAccessor + { + #region Asynchronous Operations + {{#operation}} + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// {{summary}} + /// + /// + /// {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + {{/operation}} + #endregion Asynchronous Operations + } + {{/supportsAsync}} + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} interface {{interfacePrefix}}{{classname}} : {{interfacePrefix}}{{classname}}Sync{{#supportsAsync}}, {{interfacePrefix}}{{classname}}Async{{/supportsAsync}} + { + + } + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + {{>visibility}} partial class {{classname}} : IDisposable, {{interfacePrefix}}{{classname}} + { + private {{packageName}}.Client.ExceptionFactory _exceptionFactory = (name, response) => null; + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// + public {{classname}}() : this((string)null) + { + } + + /// + /// Initializes a new instance of the class. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// The target service's base path in URL format. + /// + /// + public {{classname}}(string basePath) + { + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + new {{packageName}}.Client.Configuration { BasePath = basePath } + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class using Configuration object. + /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal. + /// It's better to reuse the HttpClient and HttpClientHandler. + /// + /// An instance of Configuration. + /// + /// + public {{classname}}({{packageName}}.Client.Configuration configuration) + { + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Configuration = {{packageName}}.Client.Configuration.MergeConfigurations( + {{packageName}}.Client.GlobalConfiguration.Instance, + configuration + ); + this.ApiClient = new {{packageName}}.Client.ApiClient(this.Configuration.BasePath); + this.Client = this.ApiClient; + {{#supportsAsync}} + this.AsynchronousClient = this.ApiClient; + {{/supportsAsync}} + ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using a Configuration object and client instance. + /// + /// The client interface for synchronous API access.{{#supportsAsync}} + /// The client interface for asynchronous API access.{{/supportsAsync}} + /// The configuration object. + /// + public {{classname}}({{packageName}}.Client.ISynchronousClient client, {{#supportsAsync}}{{packageName}}.Client.IAsynchronousClient asyncClient, {{/supportsAsync}}{{packageName}}.Client.IReadableConfiguration configuration) + { + if (client == null) throw new ArgumentNullException("client"); + {{#supportsAsync}} + if (asyncClient == null) throw new ArgumentNullException("asyncClient"); + {{/supportsAsync}} + if (configuration == null) throw new ArgumentNullException("configuration"); + + this.Client = client; + {{#supportsAsync}} + this.AsynchronousClient = asyncClient; + {{/supportsAsync}} + this.Configuration = configuration; + this.ExceptionFactory = {{packageName}}.Client.Configuration.DefaultExceptionFactory; + } + + /// + /// Disposes resources if they were created by us + /// + public void Dispose() + { + this.ApiClient?.Dispose(); + } + + /// + /// Holds the ApiClient if created + /// + public {{packageName}}.Client.ApiClient ApiClient { get; set; } = null; + + {{#supportsAsync}} + /// + /// The client for accessing this underlying API asynchronously. + /// + public {{packageName}}.Client.IAsynchronousClient AsynchronousClient { get; set; } + {{/supportsAsync}} + + /// + /// The client for accessing this underlying API synchronously. + /// + public {{packageName}}.Client.ISynchronousClient Client { get; set; } + + /// + /// Gets the base path of the API client. + /// + /// The base path + public string GetBasePath() + { + return this.Configuration.BasePath; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public {{packageName}}.Client.IReadableConfiguration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public {{packageName}}.Client.ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + + {{#operation}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// {{returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + {{#isDeepObject}} + {{#items.vars}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isDeepObject}} + {{#items.vars}} + if ({{paramName}}.{{name}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + } + {{/items.vars}} + {{^items}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); + {{/items}} + {{/isDeepObject}} + {{^isDeepObject}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/isDeepObject}} + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{#supportsAsync}} + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var task = {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken); + {{#returnType}} +#if UNITY_EDITOR || !UNITY_WEBGL + {{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await task.ConfigureAwait(false); +#else + {{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await task; +#endif + return localVarResponse.Data; + {{/returnType}} + {{^returnType}} +#if UNITY_EDITOR || !UNITY_WEBGL + await task.ConfigureAwait(false); +#else + await task; +#endif + {{/returnType}} + } + + /// + /// {{summary}} {{notes}} + /// + /// Thrown when fails to make API call + {{#allParams}} + /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} + {{/allParams}} + /// Cancellation Token to cancel the request. + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} + {{#isDeprecated}} + [Obsolete] + {{/isDeprecated}} + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + {{#allParams}} + {{#required}} + {{^vendorExtensions.x-csharp-value-type}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) + throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + + {{/vendorExtensions.x-csharp-value-type}} + {{/required}} + {{/allParams}} + + {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + {{#consumes}} + "{{{mediaType}}}"{{^-last}}, {{/-last}} + {{/consumes}} + }; + + // to determine the Accept header + string[] _accepts = new string[] { + {{#produces}} + "{{{mediaType}}}"{{^-last}},{{/-last}} + {{/produces}} + }; + + + var localVarContentType = {{packageName}}.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = {{packageName}}.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + {{#pathParams}} + {{#required}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + } + {{/required}} + {{/pathParams}} + {{#queryParams}} + {{#required}} + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); + } + {{/required}} + {{/queryParams}} + {{#headerParams}} + {{#required}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + } + {{/required}} + {{/headerParams}} + {{#formParams}} + {{#required}} + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/required}} + {{^required}} + if ({{paramName}} != null) + { + {{#isFile}} + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + } + {{/required}} + {{/formParams}} + {{#bodyParam}} + localVarRequestOptions.Data = {{paramName}}; + {{/bodyParam}} + + {{#authMethods}} + // authentication ({{name}}) required + {{#isApiKey}} + {{#isKeyInCookie}} + // cookie parameter support + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.Cookies.Add(new Cookie("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInCookie}} + {{#isKeyInHeader}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.HeaderParameters.Add("{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}")); + } + {{/isKeyInHeader}} + {{#isKeyInQuery}} + if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) + { + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); + } + {{/isKeyInQuery}} + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // http basic authentication required + if (!string.IsNullOrEmpty(this.Configuration.Username) || !string.IsNullOrEmpty(this.Configuration.Password) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + {{packageName}}.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password)); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // oauth required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + {{/isOAuth}} + {{#isHttpSignature}} + if (this.Configuration.HttpSigningConfiguration != null) + { + var HttpSigningHeaders = this.Configuration.HttpSigningConfiguration.GetHttpSignedHeader(this.Configuration.BasePath, "{{{httpMethod}}}", "{{{path}}}", localVarRequestOptions); + foreach (var headerItem in HttpSigningHeaders) + { + if (localVarRequestOptions.HeaderParameters.ContainsKey(headerItem.Key)) + { + localVarRequestOptions.HeaderParameters[headerItem.Key] = new List() { headerItem.Value }; + } + else + { + localVarRequestOptions.HeaderParameters.Add(headerItem.Key, headerItem.Value); + } + } + } + {{/isHttpSignature}} + {{/authMethods}} + + // make the HTTP request + + var task = this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("{{operationId}}", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + {{/supportsAsync}} + {{/operation}} + } + {{/operations}} +} diff --git a/templates/libraries/unityWebRequest/api_test.mustache b/templates/libraries/unityWebRequest/api_test.mustache new file mode 100644 index 0000000..0f7f49f --- /dev/null +++ b/templates/libraries/unityWebRequest/api_test.mustache @@ -0,0 +1,74 @@ +{{>partial_header}} +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using NUnit.Framework; + +using {{packageName}}.Client; +using {{packageName}}.{{apiPackage}}; +{{#hasImport}} +// uncomment below to import models +//using {{packageName}}.{{modelPackage}}; +{{/hasImport}} + +namespace {{packageName}}.Test.Api +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the API endpoint. + /// + public class {{classname}}Tests : IDisposable + { + {{^nonPublicApi}} + private {{classname}} instance; + + {{/nonPublicApi}} + public {{classname}}Tests() + { + {{^nonPublicApi}} + instance = new {{classname}}(); + {{/nonPublicApi}} + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{operationId}}InstanceTest() + { + // TODO uncomment below to test 'IsType' {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + {{#operations}} + {{#operation}} + + /// + /// Test {{operationId}} + /// + [Test] + public void {{operationId}}Test() + { + // TODO uncomment below to test the method and replace null with proper value + {{#allParams}} + //{{{dataType}}} {{paramName}} = null; + {{/allParams}} + //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}} + //Assert.IsType<{{{.}}}>(response); + {{/returnType}} + } + {{/operation}} + {{/operations}} + } +} diff --git a/templates/libraries/unityWebRequest/asmdef.mustache b/templates/libraries/unityWebRequest/asmdef.mustache new file mode 100644 index 0000000..a30cba8 --- /dev/null +++ b/templates/libraries/unityWebRequest/asmdef.mustache @@ -0,0 +1,7 @@ +{ + "name": "{{packageName}}", + "overrideReferences": true, + "precompiledReferences": [ + "Newtonsoft.Json.dll" + ] +} diff --git a/templates/libraries/unityWebRequest/asmdef_test.mustache b/templates/libraries/unityWebRequest/asmdef_test.mustache new file mode 100644 index 0000000..c5e2d58 --- /dev/null +++ b/templates/libraries/unityWebRequest/asmdef_test.mustache @@ -0,0 +1,15 @@ +{ + "name": "{{testPackageName}}", + "references": [ + "{{packageName}}", + "UnityEngine.TestRunner" + ], + "overrideReferences": true, + "precompiledReferences": [ + "nunit.framework.dll", + "Newtonsoft.Json.dll" + ], + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ] +} diff --git a/templates/libraries/unityWebRequest/model.mustache b/templates/libraries/unityWebRequest/model.mustache new file mode 100644 index 0000000..3c1c6c0 --- /dev/null +++ b/templates/libraries/unityWebRequest/model.mustache @@ -0,0 +1,47 @@ +{{>partial_header}} + +{{#models}} +{{#model}} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +{{#vendorExtensions.x-com-visible}} +using System.Runtime.InteropServices; +{{/vendorExtensions.x-com-visible}} +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +{{/model}} +{{/models}} +{{#validatable}} +using System.ComponentModel.DataAnnotations; +{{/validatable}} +using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} +{{#models}} +{{#model}} +{{#oneOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/oneOf}} +{{#anyOf}} +{{#-first}} +using System.Reflection; +{{/-first}} +{{/anyOf}} + +namespace {{packageName}}.{{modelPackage}} +{ +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{#anyOf}}{{#-first}}{{>modelAnyOf}}{{/-first}}{{/anyOf}}{{^oneOf}}{{^anyOf}}{{>modelGeneric}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} +} diff --git a/templates/libraries/unityWebRequest/model_test.mustache b/templates/libraries/unityWebRequest/model_test.mustache new file mode 100644 index 0000000..4046232 --- /dev/null +++ b/templates/libraries/unityWebRequest/model_test.mustache @@ -0,0 +1,64 @@ +{{>partial_header}} + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using {{packageName}}.{{apiPackage}}; +using {{packageName}}.{{modelPackage}}; +using {{packageName}}.{{clientPackage}}; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +{{#models}} +{{#model}} +namespace {{packageName}}.Test.Model +{ + /// + /// Class for testing {{classname}} + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class {{classname}}Tests : IDisposable + { + // TODO uncomment below to declare an instance variable for {{classname}} + //private {{classname}} instance; + + public {{classname}}Tests() + { + // TODO uncomment below to create an instance of {{classname}} + //instance = new {{classname}}(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{classname}}InstanceTest() + { + // TODO uncomment below to test "IsType" {{classname}} + //Assert.IsType<{{classname}}>(instance); + } + + {{#vars}} + /// + /// Test the property '{{name}}' + /// + [Test] + public void {{name}}Test() + { + // TODO unit test for the property '{{name}}' + } + {{/vars}} + } +} +{{/model}} +{{/models}} diff --git a/templates/modelAnyOf.mustache b/templates/modelAnyOf.mustache index 7e318b3..f3eac97 100644 --- a/templates/modelAnyOf.mustache +++ b/templates/modelAnyOf.mustache @@ -10,7 +10,7 @@ {{/vendorExtensions.x-com-visible}} [JsonConverter(typeof({{classname}}JsonConverter))] [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} { {{#isNullable}} /// @@ -18,12 +18,13 @@ /// public {{classname}}() { - this.IsNullable = true; - this.SchemaType= "anyOf"; + IsNullable = true; + SchemaType= "anyOf"; } {{/isNullable}} {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{^isNull}} /// /// Initializes a new instance of the class @@ -32,12 +33,13 @@ /// An instance of {{dataType}}. public {{classname}}({{{dataType}}} actualInstance) { - this.IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; - this.SchemaType= "anyOf"; - this.ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; + IsNullable = {{#model.isNullable}}true{{/model.isNullable}}{{^model.isNullable}}false{{/model.isNullable}}; + SchemaType= "anyOf"; + ActualInstance = actualInstance{{^model.isNullable}}{{^isPrimitiveType}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isPrimitiveType}}{{#isPrimitiveType}}{{#isArray}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isArray}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isFreeFormObject}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isString}} ?? throw new ArgumentException("Invalid instance found. Must not be null."){{/isString}}{{/isPrimitiveType}}{{/model.isNullable}}; } {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.anyOf}} private Object _actualInstance; @@ -56,7 +58,7 @@ {{#anyOf}} {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) { - this._actualInstance = value; + _actualInstance = value; } {{/anyOf}} else @@ -66,6 +68,7 @@ } } {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{^isNull}} /// @@ -75,9 +78,10 @@ /// An instance of {{dataType}} public {{{dataType}}} Get{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}}{{#isArray}}{{#lambda.titlecase}}{{{dataFormat}}}{{/lambda.titlecase}}{{/isArray}}() { - return ({{{dataType}}})this.ActualInstance; + return ({{{dataType}}})ActualInstance; } {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.anyOf}} /// @@ -88,7 +92,7 @@ { var sb = new StringBuilder(); sb.Append("class {{classname}} {\n"); - sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n"); + sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -99,7 +103,7 @@ /// JSON string presentation of the object public override string ToJson() { - return JsonConvert.SerializeObject(this.ActualInstance, {{classname}}.SerializerSettings); + return JsonConvert.SerializeObject(ActualInstance, {{classname}}.SerializerSettings); } /// @@ -133,6 +137,7 @@ // no match found, throw an exception throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined."); } + {{#equatable}} /// /// Returns true if objects are equal @@ -145,7 +150,7 @@ return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; {{/useCompareNetObjects}} {{^useCompareNetObjects}} - return this.Equals(input as {{classname}}); + return Equals(input as {{classname}}); {{/useCompareNetObjects}} } @@ -163,7 +168,7 @@ if (input == null) return false; - return this.ActualInstance.Equals(input.ActualInstance); + return ActualInstance.Equals(input.ActualInstance); {{/useCompareNetObjects}} } @@ -176,11 +181,12 @@ unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.ActualInstance != null) - hashCode = hashCode * 59 + this.ActualInstance.GetHashCode(); + if (ActualInstance != null) + hashCode = hashCode * 59 + ActualInstance.GetHashCode(); return hashCode; } } + {{/equatable}} {{#validatable}} /// @@ -221,11 +227,39 @@ /// The object converted from the JSON string public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { - if(reader.TokenType != JsonToken.Null) + switch(reader.TokenType) { - return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + {{#composedSchemas.anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{#isInteger}} + case JsonToken.Integer: + return new {{classname}}(Convert.ToInt32(reader.Value)); + {{/isInteger}} + {{#isNumber}} + case JsonToken.Float: + return new {{classname}}(Convert.ToDecimal(reader.Value)); + {{/isNumber}} + {{#isString}} + case JsonToken.String: + return new {{classname}}(Convert.ToString(reader.Value)); + {{/isString}} + {{#isBoolean}} + case JsonToken.Boolean: + return new {{classname}}(Convert.ToBoolean(reader.Value)); + {{/isBoolean}} + {{#isDate}} + case JsonToken.Date: + return new {{classname}}(Convert.ToDateTime(reader.Value)); + {{/isDate}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.anyOf}} + case JsonToken.StartObject: + return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; } - return null; } /// diff --git a/templates/modelEnum.mustache b/templates/modelEnum.mustache index 514542d..37fb53f 100644 --- a/templates/modelEnum.mustache +++ b/templates/modelEnum.mustache @@ -29,10 +29,157 @@ /// Enum {{name}} for value: {{value}} /// {{#isString}} + {{^useGenericHost}} + {{! EnumMember not currently supported in System.Text.Json, use a converter instead }} [EnumMember(Value = "{{{value}}}")] + {{/useGenericHost}} {{/isString}} - {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}} = {{-index}}{{/isString}}{{^-last}},{{/-last}} + {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} + {{^-last}} + {{/-last}} {{/enumVars}} {{/allowableValues}} - }{{! NOTE: This model's enumVars is modified to look like CodegenProperty}} + } + {{#useGenericHost}} + + /// + /// Converts to and from the JSON value + /// + public static class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter + { + /// + /// Parses a given value to + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} FromString(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); + } + + /// + /// Parses a given value to + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? FromStringOrDefault(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + /// + public static {{>EnumValueDataType}} ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} value) + { + {{^isString}} + return ({{>EnumValueDataType}}) value; + {{/isString}} + {{#isString}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isString}} + } + } + + /// + /// A Json converter for type + /// + /// + public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> + { + /// + /// Returns a {{datatypeWithEnum}} from the Json object + /// + /// + /// + /// + /// + public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string{{nrt?}} rawValue = reader.GetString(); + + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null + ? null + : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) + { + writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.ToString()); + } + } + + /// + /// A Json converter for type + /// + public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}?> + { + /// + /// Returns a {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} from the Json object + /// + /// + /// + /// + /// + public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + string{{nrt?}} rawValue = reader.GetString(); + + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null + ? null + : {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + + if (result != null) + return result.Value; + + throw new JsonException(); + } + + /// + /// Writes the DateTime to the json writer + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) + { + writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}?.ToString() ?? "null"); + } + } + {{/useGenericHost}} diff --git a/templates/modelGeneric.mustache b/templates/modelGeneric.mustache index c5dc0a6..7392b27 100644 --- a/templates/modelGeneric.mustache +++ b/templates/modelGeneric.mustache @@ -8,14 +8,21 @@ [ComVisible({{{vendorExtensions.x-com-visible}}})] {{/vendorExtensions.x-com-visible}} [DataContract(Name = "{{{name}}}")] + {{^useUnityWebRequest}} {{#discriminator}} [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")] {{#mappedModels}} [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] {{/mappedModels}} {{/discriminator}} + {{/useUnityWebRequest}} +{{^useCustomTemplateCode}} + {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}} : .{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] - {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IOpenApiTyped, IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, IOpenApiTyped, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} +{{/useCustomTemplateCode}} { {{#vars}} {{#items.isEnum}} @@ -38,6 +45,9 @@ {{#description}} /// {{.}} {{/description}} + {{#example}} + /// {{.}} + {{/example}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} @@ -104,6 +114,9 @@ {{/conditionalSerialization}} {{/isEnum}} {{/vars}} +{{^useCustomTemplateCode}} + {{#hasRequired}} + {{^hasOnlyReadOnly}} /// /// Initializes a new instance of the class. /// @@ -117,47 +130,81 @@ this.AdditionalProperties = new Dictionary(); } {{/isAdditionalPropertiesTrue}} + {{/hasOnlyReadOnly}} + {{/hasRequired}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + {{^isAdditionalPropertiesTrue}} + protected {{classname}}() { } + {{/isAdditionalPropertiesTrue}} + {{#isAdditionalPropertiesTrue}} + protected {{classname}}() + { + this.AdditionalProperties = new Dictionary(); + } + {{/isAdditionalPropertiesTrue}} +{{/useCustomTemplateCode}} /// /// Initializes a new instance of the class. /// {{#readWriteVars}} - /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. + /// {{description}}{{^description}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. {{/readWriteVars}} {{#hasOnlyReadOnly}} [JsonConstructorAttribute] {{/hasOnlyReadOnly}} - public {{classname}}({{#readWriteVars}}{{#vendorExtensions.x-int-or-string}}Object{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{datatypeWithEnum}}}{{/vendorExtensions.x-int-or-string}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#vendorExtensions.x-int-or-string}}null{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#defaultValue}}{{^isDateTime}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{/vendorExtensions.x-int-or-string}}{{^-last}}, {{/-last}}{{/readWriteVars}}) +{{^useCustomTemplateCode}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + { +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + public {{classname}}({{#readWriteVars}}{{#vendorExtensions.x-int-or-string}}Object{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{{datatypeWithEnum}}}{{/vendorExtensions.x-int-or-string}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#vendorExtensions.x-int-or-string}}null{{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{/vendorExtensions.x-int-or-string}}{{^-last}}, {{/-last}}{{/readWriteVars}}) { - {{#parent}}{{#parentVars}}this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/vendorExtensions.x-int-or-string}}; + {{#parent}}{{#parentVars}}this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/vendorExtensions.x-int-or-string}}; {{/parentVars}}{{/parent}} +{{/useCustomTemplateCode}} {{#vars}} {{^isInherited}} {{^isReadOnly}} {{#required}} {{^conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} - // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) + // to ensure "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" is required (not null) + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null) { - throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + throw new ArgumentNullException("{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} is a required property for {{classname}} and cannot be null"); } - this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/vendorExtensions.x-int-or-string}}; +{{^useCustomTemplateCode}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/vendorExtensions.x-int-or-string}}; +{{/useCustomTemplateCode}} {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/vendorExtensions.x-int-or-string}}; +{{^useCustomTemplateCode}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/vendorExtensions.x-int-or-string}}; +{{/useCustomTemplateCode}} {{/vendorExtensions.x-csharp-value-type}} {{/conditionalSerialization}} {{#conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} - // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) + // to ensure "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" is required (not null) + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null) { - throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); + throw new ArgumentNullException("{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} is a required property for {{classname}} and cannot be null"); } - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; {{/vendorExtensions.x-csharp-value-type}} {{/conditionalSerialization}} {{/required}} @@ -171,20 +218,35 @@ {{#defaultValue}} {{^conditionalSerialization}} {{^vendorExtensions.x-csharp-value-type}} - // use default value if no "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" provided - this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? {{{defaultValue}}}{{/vendorExtensions.x-int-or-string}}; + // use default value if no "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" provided +{{^useCustomTemplateCode}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} ?? {{#isString}}@{{/isString}}{{{defaultValue}}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} ?? {{{defaultValue}}}{{/vendorExtensions.x-int-or-string}}; +{{/useCustomTemplateCode}} {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} - this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/vendorExtensions.x-int-or-string}}; +{{^useCustomTemplateCode}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/vendorExtensions.x-int-or-string}}; +{{/useCustomTemplateCode}} {{/vendorExtensions.x-csharp-value-type}} {{/conditionalSerialization}} {{/defaultValue}} {{^defaultValue}} {{^conditionalSerialization}} - this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/vendorExtensions.x-int-or-string}}; +{{^useCustomTemplateCode}} + this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + this.{{name}} = {{#vendorExtensions.x-int-or-string}}Convert.ToString({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}){{/vendorExtensions.x-int-or-string}}{{^vendorExtensions.x-int-or-string}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/vendorExtensions.x-int-or-string}}; +{{/useCustomTemplateCode}} {{/conditionalSerialization}} {{#conditionalSerialization}} - this._{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; if (this.{{name}} != null) { this._flag{{name}} = true; @@ -199,6 +261,7 @@ this.AdditionalProperties = new Dictionary(); {{/isAdditionalPropertiesTrue}} } +{{#useCustomTemplateCode}} {{^mappedModels}} /// @@ -217,6 +280,7 @@ return obj; } {{/mappedModels}} +{{/useCustomTemplateCode}} {{#vars}} {{^isInherited}} @@ -225,21 +289,33 @@ /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} /// {{.}}{{/description}} + {{#example}} + /// {{.}} + {{/example}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})] {{#isDate}} + {{^supportsDateOnly}} [JsonConverter(typeof(OpenAPIDateConverter))] + {{/supportsDateOnly}} {{/isDate}} {{#deprecated}} [Obsolete] {{/deprecated}} - {{^vendorExtensions.x-int-or-string}}public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{/vendorExtensions.x-int-or-string}}{{#vendorExtensions.x-int-or-string}}public object {{name}} { - get => this._{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - set => this._{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = Convert.ToString(value); +{{^useCustomTemplateCode}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + {{^vendorExtensions.x-int-or-string}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } + {{/vendorExtensions.x-int-or-string}} + {{#vendorExtensions.x-int-or-string}}public object {{name}} { + get => this._{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; + set => this._{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = Convert.ToString(value); } - private string _{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}};{{/vendorExtensions.x-int-or-string}} - + private string _{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}};{{/vendorExtensions.x-int-or-string}} +{{/useCustomTemplateCode}} {{#isReadOnly}} /// /// Returns false as {{name}} should not be serialized given that it's read-only. @@ -341,6 +417,7 @@ { return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } +{{! CUSTOM - remove #equatable }} /// /// Returns true if objects are equal @@ -429,7 +506,12 @@ return hashCode; } } +{{! CUSTOM - remove /equatable }} +{{#validatable}} +{{>validatable}} +{{/validatable}} +{{#useCustomTemplateCode}} public List GetOpenApiTypes() { var types = new List(); @@ -444,8 +526,5 @@ return types; } - -{{#validatable}} -{{>validatable}} -{{/validatable}} +{{/useCustomTemplateCode}} } diff --git a/templates/modelInnerEnum.mustache b/templates/modelInnerEnum.mustache index f879f02..462ded8 100644 --- a/templates/modelInnerEnum.mustache +++ b/templates/modelInnerEnum.mustache @@ -17,12 +17,83 @@ /// /// Enum {{name}} for value: {{value}} /// + {{^useGenericHost}} {{#isString}} [EnumMember(Value = "{{{value}}}")] {{/isString}} - {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}} = {{-index}}{{/isString}}{{^-last}},{{/-last}} + {{/useGenericHost}} + {{name}}{{^isString}} = {{{value}}}{{/isString}}{{#isString}}{{^vendorExtensions.x-zero-based-enum}} = {{-index}}{{/vendorExtensions.x-zero-based-enum}}{{/isString}}{{^-last}},{{/-last}} + {{^-last}} + {{/-last}} {{/enumVars}} {{/allowableValues}} } - {{/isContainer}} + {{#useGenericHost}} + + /// + /// Returns a + /// + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromString(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Could not convert value to type {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}: '{value}'"); + } + + /// + /// Returns a + /// + /// + /// + public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}FromStringOrDefault(string value) + { + {{#allowableValues}} + {{#enumVars}} + if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; + + {{/enumVars}} + {{/allowableValues}} + return null; + } + + /// + /// Converts the to the json value + /// + /// + /// + {{#isString}} + /// + {{/isString}} + public static {{>EnumValueDataType}}{{#lambda.first}}{{#nrt}}{{#isString}}{{#isNullable}}{{nrt?}} {{^nrt}}{{#vendorExtensions.x-is-value-type}}? {{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}}{{/isString}}{{/nrt}}{{/lambda.first}} {{datatypeWithEnum}}ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#isString}}{{>NullConditionalProperty}}{{/isString}} value) + { + {{^isString}} + return ({{>EnumValueDataType}}) value; + {{/isString}} + {{#isString}} + {{#isNullable}} + if (value == null) + return null; + + {{/isNullable}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{^isNumeric}}"{{/isNumeric}}{{{value}}}{{^isNumeric}}"{{/isNumeric}}; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isString}} + } + {{/useGenericHost}} + {{/isContainer}} \ No newline at end of file diff --git a/templates/modelOneOf.mustache b/templates/modelOneOf.mustache index a7756c1..ab42e4e 100644 --- a/templates/modelOneOf.mustache +++ b/templates/modelOneOf.mustache @@ -10,7 +10,7 @@ {{/vendorExtensions.x-com-visible}} [JsonConverter(typeof({{classname}}JsonConverter))] [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : {{#lambda.joinWithComma}}AbstractOpenAPISchema {{#parent}}{{{.}}} {{/parent}}{{#equatable}}IEquatable<{{classname}}> {{/equatable}}{{#validatable}}IValidatableObject {{/validatable}}{{/lambda.joinWithComma}} { {{#isNullable}} /// @@ -24,6 +24,7 @@ {{/isNullable}} {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{^isNull}} /// /// Initializes a new instance of the class @@ -38,6 +39,7 @@ } {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} private Object _actualInstance; @@ -54,7 +56,7 @@ set { {{#oneOf}} - {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}})) + {{^-first}}else {{/-first}}if (value.GetType() == typeof({{{.}}}) || value is {{{.}}}) { this._actualInstance = value; } @@ -66,6 +68,7 @@ } } {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{^isNull}} /// @@ -78,6 +81,7 @@ return ({{{dataType}}})this.ActualInstance; } {{/isNull}} + {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} /// @@ -172,13 +176,14 @@ } else if (match > 1) { - throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes); + throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + String.Join(",", matchedTypes)); } // deserialization is considered successful at this point if no exception has been thrown. return new{{classname}}; } + {{#equatable}} /// /// Returns true if objects are equal /// @@ -226,8 +231,9 @@ return hashCode; } } - + {{/equatable}} {{#validatable}} + /// /// To validate all properties of the instance /// @@ -266,11 +272,39 @@ /// The object converted from the JSON string public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { - if(reader.TokenType != JsonToken.Null) + switch(reader.TokenType) { - return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + {{#composedSchemas.oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} + {{#isInteger}} + case JsonToken.Integer: + return new {{classname}}(Convert.ToInt32(reader.Value)); + {{/isInteger}} + {{#isNumber}} + case JsonToken.Float: + return new {{classname}}(Convert.ToDecimal(reader.Value)); + {{/isNumber}} + {{#isString}} + case JsonToken.String: + return new {{classname}}(Convert.ToString(reader.Value)); + {{/isString}} + {{#isBoolean}} + case JsonToken.Boolean: + return new {{classname}}(Convert.ToBoolean(reader.Value)); + {{/isBoolean}} + {{#isDate}} + case JsonToken.Date: + return new {{classname}}(Convert.ToDateTime(reader.Value)); + {{/isDate}} + {{/vendorExtensions.x-duplicated-data-type}} + {{/composedSchemas.oneOf}} + case JsonToken.StartObject: + return {{classname}}.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return {{classname}}.FromJson(JArray.Load(reader).ToString(Formatting.None)); + default: + return null; } - return null; } /// diff --git a/templates/model_doc.mustache b/templates/model_doc.mustache index 9e73307..7dd060c 100644 --- a/templates/model_doc.mustache +++ b/templates/model_doc.mustache @@ -10,11 +10,21 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- {{#parent}} {{#parentVars}} +{{^useCustomTemplateCode}} +**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/useCustomTemplateCode}} {{/parentVars}} {{/parent}} -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{^useCustomTemplateCode}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | REPLACE_ME_WITH_DESCRIPTION_BEGIN {{unescapedDescription}} REPLACE_ME_WITH_DESCRIPTION_END | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}{{/vars}} +{{/useCustomTemplateCode}} [[Back to Model list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-models) [[Back to API list]](../{{#useGenericHost}}../{{/useGenericHost}}README.md#documentation-for-api-endpoints) [[Back to README]](../{{#useGenericHost}}../{{/useGenericHost}}README.md) diff --git a/templates/model_test.mustache b/templates/model_test.mustache index b4aefe5..1feaeb9 100644 --- a/templates/model_test.mustache +++ b/templates/model_test.mustache @@ -6,11 +6,12 @@ using System; using System.Linq; using System.IO; using System.Collections.Generic; -using {{packageName}}.{{apiPackage}}; using {{packageName}}.{{modelPackage}}; -using {{packageName}}.Client; +using {{packageName}}.{{clientPackage}}; using System.Reflection; +{{^useGenericHost}} using Newtonsoft.Json; +{{/useGenericHost}} {{#models}} {{#model}} @@ -39,6 +40,8 @@ namespace {{packageName}}.Test.Model // Cleanup when everything is done. } + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.trimLineBreaks}} /// /// Test an instance of {{classname}} /// @@ -51,6 +54,7 @@ namespace {{packageName}}.Test.Model {{#discriminator}} {{#children}} + /// /// Test deserialize a {{classname}} from type {{parent}} /// @@ -60,10 +64,12 @@ namespace {{packageName}}.Test.Model // TODO uncomment below to test deserialize a {{classname}} from type {{parent}} //Assert.IsType<{{parent}}>(JsonConvert.DeserializeObject<{{parent}}>(new {{classname}}().ToJson())); } + {{/children}} {{/discriminator}} - {{#vars}} + + /// /// Test the property '{{name}}' /// @@ -73,9 +79,9 @@ namespace {{packageName}}.Test.Model // TODO unit test for the property '{{name}}' } {{/vars}} - + {{/lambda.trimLineBreaks}} + {{/lambda.trimTrailingWithNewLine}} } - } {{/model}} {{/models}} diff --git a/templates/netcore_project.additions.mustache b/templates/netcore_project.additions.mustache new file mode 100644 index 0000000..8c6f3ad --- /dev/null +++ b/templates/netcore_project.additions.mustache @@ -0,0 +1 @@ +{{! if needed users can add this file to their templates folder to append to the csproj }} \ No newline at end of file diff --git a/templates/netcore_project.mustache b/templates/netcore_project.mustache index 0bacbad..01717e6 100644 --- a/templates/netcore_project.mustache +++ b/templates/netcore_project.mustache @@ -11,41 +11,84 @@ {{packageCompany}} {{packageTitle}} {{packageDescription}} + {{packageCopyright}} {{packageName}} {{packageVersion}} bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} {{.}}{{/licenseId}} +{{^useCustomTemplateCode}} + https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} https://github.com/hellosign/dropbox-sign-dotnet.git +{{/useCustomTemplateCode}} git{{#releaseNote}} {{.}}{{/releaseNote}}{{#packageTags}} {{{.}}}{{/packageTags}}{{#nrt}} {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} + false {{#useCompareNetObjects}} - + {{/useCompareNetObjects}} {{^useGenericHost}} - - + + + {{/useGenericHost}} + {{#useRestSharp}} +{{^useCustomTemplateCode}} + +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + +{{/useCustomTemplateCode}} + {{/useRestSharp}} + {{#useGenericHost}} + + + {{#supportsRetry}} + + {{/supportsRetry}} + {{#net80OrLater}} + + {{/net80OrLater}} + {{^net60OrLater}} + + {{#net47OrLater}} + + {{/net47OrLater}} + {{/net60OrLater}} + {{/useGenericHost}} + {{^useGenericHost}} + {{#supportsRetry}} + + {{/supportsRetry}} {{/useGenericHost}} - {{#useRestSharp}} - - {{/useRestSharp}} - {{#useGenericHost}} - - - {{#supportsRetry}} - - {{/supportsRetry}} - {{/useGenericHost}} - {{#supportsRetry}} - - {{/supportsRetry}} {{#validatable}} + {{^net60OrLater}} + {{/net60OrLater}} {{/validatable}} - +{{^useGenericHost}} + + {{^net60OrLater}} + + {{/net60OrLater}} + {{#net48}} + + {{/net48}} + + + {{^net60OrLater}} + + {{/net60OrLater}} + {{#net48}} + + {{/net48}} + +{{/useGenericHost}} +{{>netcore_project.additions}} diff --git a/templates/netcore_testproject.additions.mustache b/templates/netcore_testproject.additions.mustache new file mode 100644 index 0000000..8c6f3ad --- /dev/null +++ b/templates/netcore_testproject.additions.mustache @@ -0,0 +1 @@ +{{! if needed users can add this file to their templates folder to append to the csproj }} \ No newline at end of file diff --git a/templates/netcore_testproject.mustache b/templates/netcore_testproject.mustache index 329b982..90d11eb 100644 --- a/templates/netcore_testproject.mustache +++ b/templates/netcore_testproject.mustache @@ -9,13 +9,12 @@ - - - + + + - - +{{>netcore_testproject.additions}} diff --git a/templates/nuspec.mustache b/templates/nuspec.mustache index b8ef5a0..b473cbd 100644 --- a/templates/nuspec.mustache +++ b/templates/nuspec.mustache @@ -30,19 +30,24 @@ - + {{#useRestSharp}} - +{{^useCustomTemplateCode}} + +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + +{{/useCustomTemplateCode}} {{/useRestSharp}} {{#useCompareNetObjects}} {{/useCompareNetObjects}} - + {{#validatable}} {{/validatable}} {{#supportsRetry}} - + {{/supportsRetry}} diff --git a/templates/openapi.mustache b/templates/openapi.mustache new file mode 100644 index 0000000..34fbb53 --- /dev/null +++ b/templates/openapi.mustache @@ -0,0 +1 @@ +{{{openapi-yaml}}} diff --git a/templates/validatable.mustache b/templates/validatable.mustache index 6322bf5..140ff92 100644 --- a/templates/validatable.mustache +++ b/templates/validatable.mustache @@ -4,7 +4,7 @@ /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { return this.BaseValidate(validationContext); } @@ -14,22 +14,48 @@ /// /// Validation context /// Validation Result - protected IEnumerable BaseValidate(ValidationContext validationContext) + protected IEnumerable BaseValidate(ValidationContext validationContext) { {{/discriminator}} {{^discriminator}} + {{#parent}} /// /// To validate all properties of the instance /// /// Validation context /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + {{/parent}} + {{^parent}} + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + {{/parent}} {{/discriminator}} {{#parent}} {{^isArray}} {{^isMap}} +{{^useCustomTemplateCode}} + foreach (var x in {{#discriminator}}base.{{/discriminator}}BaseValidate(validationContext)) +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} foreach (var x in BaseValidate(validationContext)) +{{/useCustomTemplateCode}} { yield return x; } @@ -43,7 +69,7 @@ // {{{name}}} ({{{dataType}}}) maxLength if (this.{{{name}}} != null && this.{{{name}}}.Length > {{maxLength}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}" }); } {{/maxLength}} @@ -51,35 +77,60 @@ // {{{name}}} ({{{dataType}}}) minLength if (this.{{{name}}} != null && this.{{{name}}}.Length < {{minLength}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}" }); } {{/minLength}} {{#maximum}} // {{{name}}} ({{{dataType}}}) maximum - if (this.{{{name}}} > ({{{dataType}}}){{maximum}}) + if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} {{#exclusiveMaximum}}<={{/exclusiveMaximum}}{{^exclusiveMaximum}}>{{/exclusiveMaximum}} ({{{dataType}}}){{maximum}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value less than or equal to {{maximum}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.", new [] { "{{{name}}}" }); } {{/maximum}} {{#minimum}} // {{{name}}} ({{{dataType}}}) minimum - if (this.{{{name}}} < ({{{dataType}}}){{minimum}}) + if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} {{#exclusiveMaximum}}>={{/exclusiveMaximum}}{{^exclusiveMaximum}}<{{/exclusiveMaximum}} ({{{dataType}}}){{minimum}}) { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must be a value greater than or equal to {{minimum}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.", new [] { "{{{name}}}" }); } {{/minimum}} {{#pattern}} {{^isByteArray}} - // {{{name}}} ({{{dataType}}}) pattern - Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}); - if (false == regex{{{name}}}.Match(this.{{{name}}}).Success) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" }); + {{#vendorExtensions.x-is-value-type}} + {{#isNullable}} + if (this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null){ + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>ValidateRegex}} + {{/lambda.indent4}} + + {{/lambda.trimTrailingWithNewLine}} + } + + {{/isNullable}} + {{^isNullable}} + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent3}} + {{>ValidateRegex}} + {{/lambda.indent3}} + + {{/lambda.trimTrailingWithNewLine}} + {{/isNullable}} + {{/vendorExtensions.x-is-value-type}} + {{^vendorExtensions.x-is-value-type}} + if (this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null) { + {{#lambda.trimTrailingWithNewLine}} + {{#lambda.indent4}} + {{>ValidateRegex}} + {{/lambda.indent4}} + + {{/lambda.trimTrailingWithNewLine}} } + {{/vendorExtensions.x-is-value-type}} {{/isByteArray}} {{/pattern}} {{/isEnum}}